logo elektroda
logo elektroda
X
logo elektroda
REKLAMA
REKLAMA
Adblock/uBlockOrigin/AdGuard mogą powodować znikanie niektórych postów z powodu nowej reguły.

ATMEGA8 Bascom AVR - Menu na LCD 16x2, zapis do EEPROM, przyciski UP/DOWN

DJ_DOGGY 18 Maj 2016 11:45 1026 5
REKLAMA
  • #1 15682400
    DJ_DOGGY
    Poziom 10  
    Hello to all programmers,

    Can anybody hint me with a routine for Bascom AVR ?
    Here is the idea:

    LCD 16x2 is connected and must display the choice

    Menu for selecting a constant (i.e variable constant) by UP/DOWN buttons - from 1 to 150 , and then store it with third button.Constant is displayed as number, which is increased or decreased by the buttons.

    This constant is good to be saved in the eeprom too and when supply is down and then up, to be the same as the last saved (i.e. to be read from it after power supply back).

    No matter what ports you will define for the buttons.

    Any one can write example for this ?
    Thank you for your help and sorry fot that i don`t speak Polish.
  • REKLAMA
  • #2 15685552
    Konto nie istnieje
    Konto nie istnieje  
  • REKLAMA
  • #3 15685808
    DJ_DOGGY
    Poziom 10  
    Thanks for the reply.
    I need only the main routine for the thing i wrote above, because i`ll try to build the menu myself.
    Now for your questions
    1. Yes it`s more good to be autorepeat"able"
    2. LCD may display the "value" to the second row

    Yes i need it for just one variable - limited from 1 to X (in my case i wrote 150). I call it "variable constant" because it will be changed by the buttons. And if i set it to 100 , than the constant will be 100. Then if i change it to 65, than the constant will be 65.

    This constant will be used for a formula for different situations. That is why i need to set a value to the constant

    Let`s say it this way - take it as "voltage meter" . We have one voltage generator with XXX Volts. Then i have to set external divider to match the 0-5V at which limits the mCU is measuring.

    Let`s say i have 200V max and i must do an external divider of 40:1 . So i must choose in the software meter constant of 40 .

    Then another case - if have max of 500V , than my external divider must be 100:1 . So i must choose in the meter constant of 100.

    And i need just that menu for choosing a constant value limited from 0 to 150 and save it for continuous work ( including... if i restart the meter, it must use the "last saved value"

    Hope this explanation to help a lot more
  • REKLAMA
  • #4 15685976
    Konto nie istnieje
    Konto nie istnieje  
  • REKLAMA
  • #5 15686107
    DJ_DOGGY
    Poziom 10  
    I`ll test it but with this "autosave" it`s little complicated

    Isn`t more easy to use third button (as i stated in first post) for saving. This way will never be "unattended saving" after moving the value. I think ths way will be as little as possible use of eeprom . But every time i move the value , it will save within 3 s. But if i move it more times and finally i`m ready - then i will press the "Save" button and that`s it.

    Anyway, thanks for the help . Will try to understand it.
  • #6 15686148
    Konto nie istnieje
    Konto nie istnieje  
REKLAMA