Changing Settings ???


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tico View Post
    What I would like to do is use a few switches and/or a serial port to change the setting of the thermostat ie. Mode Summer/Winter, High Set Point, Low Setpoint and cant seem to find any code samples.

    How do you store settings in a PIC and use a switch input to change those settings.

    .
    Hi,Tico

    First you'll have to choose how to "poll" the request for changes ...

    Interrupts looks the easiest way , as interrupts on port change, and interrupt on USART receive already exist aboard your PIC !!!

    Then, just decide which coding you'll choose for the differents parameters ( serial input ) , and which menu you'll write for button programming ... looks a LCD could be useful here ...

    After that, when the "valid" switch pushed or serial code will be received, just write parameters to their respective EEPROM locations ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  2. #2
    Join Date
    Dec 2006
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    Thanks b1arrk5
    I started feeling left out and thought that maybe I asked a question with an obvious answer, I did scour the forum and found a post about a clock that used switches to set the time, I am using that code by Melanie as my basis for the input, of course I am trying to find that post now for reference and cant find it, I believe I still have an excess of eggnog floating around also.
    I did find the file on my pc though it is mn1307.bas

    Would I be correct to say that I could just add the SEROUT2 command everwhere it has an LCDOUT command and vice versa with the input switch use a SERIN2 command.
    I pasted a section of code below to show what I mean

    SetupLoop:
    LCDOut $FE,1,"Set "
    SEROUT2 "Set"

    '
    ' First Display the Menu Prompts
    ' ------------------------------
    ' This is a crude way of doing the entry Menu's but it was
    ' pretty fast and quite mindless to program this lunch-hour
    '
    If CounterC=0 then
    LCDOut "Mode"
    SEROUT2 "Mode"

    I am hoping that this method will work.....

    Thanks for the suggestion for set point variable being between 55 and 95 I didnt think of that one.
    And yes I will be using the LM34CAZ so the temperature will be in deg F.
    Yes the LM34 outputs 10mV per deg F that is what I am pumping into the ADC with a Vref so that no conversion is necessary.

    This is a starting point project for myself I have tried this a few time before with no gain. Now that I am using PicBasic it seems to make more sense and I can actually get code to compile (not like in ASM). I have no issues when it comes to hadware but the programming end of it needs alot of work for myself.

    Thanks to all that contributed on this forum and I hope to hear from others soon.

Similar Threads

  1. Changing Swordfish code to PBP
    By Ron Marcus in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th April 2008, 01:28
  2. Config settings
    By Adrian in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th December 2007, 18:24
  3. Changing the Configuration Settings
    By kiwipiper in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 24th October 2007, 07:33
  4. ADCIN - AD settings are wrong
    By teverett in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th December 2006, 16:32
  5. Changing 18F WDT postscaler on-the-fly
    By Bruce in forum Code Examples
    Replies: 4
    Last Post: - 1st August 2006, 21:09

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts