|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Is there a way to save a value in a program after the power had been lost and then recover the value after the power is reaplied?
Thanks ^_^' |
|
#2
|
||||
|
||||
|
Re: Save a variable
Yes, you can use the EEPROM on the RC. Check out this thread for details and code that will let you do it. Be aware that you can't write to the EEPROM every loop in the RC or you'll wear it out.
|
|
#3
|
|||
|
|||
|
EEPROM Lifetimes
As far as I know (not an expert by any means), most EEPROMs are good for at least a million write cycles. So don't go writing to it every cycle, but every second should be fine.
|
|
#4
|
|||
|
|||
|
Re: EEPROM Lifetimes
Quote:
Once per second gives 277 hours, longer, probably longer than you will need for the robot. But depending on the variable, it could be longer. How often does the variable change? if it is not that often, you could detect when it changes, and then save it. |
|
#5
|
|||
|
|||
|
Re: EEPROM Lifetimes
Quote:
What I had in mind, however, was a variable that is constantly changing (like position, for example), but you don't want to exhaust your EEPROM. So you write only every second. That gives you reasonably up-to-date information, but many fewer write cycles, greatly extending the life of your EEPROM. |
|
#6
|
|||
|
|||
|
Re: EEPROM Lifetimes
honestly, i think your best bet would be to have a button to save the value that you should press before you turn it off-- that saves a lot of writes, even though it requires user intervention
|
|
#7
|
|||||
|
|||||
|
Re: EEPROM Lifetimes
Quote:
|
|
#8
|
||||
|
||||
|
Re: EEPROM Lifetimes
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I save a quicktime .mov file? | Elgin Clock | IT / Communications | 20 | 18-03-2005 17:39 |
| Program for variable speed | cabbagekid2 | Programming | 5 | 12-01-2005 13:20 |
| Interrupt Handlers and Variable Scope | kaszeta | Programming | 2 | 14-02-2004 18:30 |
| Pic Block (save server space) | Jack | CD Forum Support | 3 | 22-09-2002 01:05 |
| what teams have a variable transmissions? | Greg Perkins | Technical Discussion | 4 | 06-03-2002 06:10 |