Arduino Forum

Forum 2005-2010 (read only) => Hardware => Interfacing => Topic started by: baum on Jan 07, 2011, 09:24 pm

Title: EEPROM
Post by: baum on Jan 07, 2011, 09:24 pm
In theory, could I load a VERY small program into the EEPROM, and then, at a certain point in my code, load the program?

Ex.
I run my very complex program until a button is pressed. The arduino then loads this program:

Code: [Select]
void setup() {}
void loop() {}


(It's my null program, it does nothing and takes up 450bytes of space.)
Title: Re: EEPROM
Post by: Coding Badly on Jan 07, 2011, 09:27 pm

Why would you want to do that?
Title: Re: EEPROM
Post by: baum on Jan 07, 2011, 09:35 pm
Quote
[glow]In theory,[/glow] could I load a VERY small program into the EEPROM, and then, at a certain point in my code, load the program?


I never said I did.
Title: Re: EEPROM
Post by: mowcius on Jan 07, 2011, 10:12 pm
It would be completely pointless... In theory you could make a cannon which fired toasters - not a lot of point to it.

You are better off just making them different looping functions and having the button as an interrupt to run some code to switch between them  ;)
Title: Re: EEPROM
Post by: billroy on Jan 07, 2011, 10:17 pm
Programs in EEPROM?  No problem: http://bitlash.net

;)

-br
http://bitlash.net
http://entropymouse.com
Title: Re: EEPROM
Post by: baum on Jan 07, 2011, 10:43 pm
Quote
Do you just pull these ideas at random out of thin air?


Yes, I did. I pressurized the air in my house and put into a sealed flask with this:
http://www.sparkfun.com/products/10221
As the air evaporated, the levels were fed from the sensor to my arduino, which output the data as ASCII.
Title: Re: EEPROM
Post by: PaulS on Jan 07, 2011, 11:06 pm
Quote
Yes, I did.

Good thing you told us. I was beginning the think you'd pulled them from somewhere else.  ;)