Download a program into the Boe Bot without it automatically starting?
czetie
Posts: 7
OK, I'm sure this question must have been asked before... but I can't find a set of search terms that brings up anything relevant :-(
Is it possible to download a program into the Boe Bot's EEPROM but not have it start executing immediately?
I'm working my way through the beginner's textbook, and for a lot of the exercises I'd really prefer that the wheels not start spinning (etc.) until I've had a chance to detach the serial cable, switch from power adapter to batteries, and move the robot to the floor... I also expect that once I get into more custom stuff, like maze-solving, I'll want to be able to make it wait patiently until I tell it go.
I know I could do this using some kind of sensor (e.g. after program initialization, have the program wait for a touch on the whiskers or a flash of light); or leave the power switch at position 1 until I'm ready to go, push it to 2 then quickly hit reset; but is there anything slicker/less power consuming?
thanks,
Carl
Is it possible to download a program into the Boe Bot's EEPROM but not have it start executing immediately?
I'm working my way through the beginner's textbook, and for a lot of the exercises I'd really prefer that the wheels not start spinning (etc.) until I've had a chance to detach the serial cable, switch from power adapter to batteries, and move the robot to the floor... I also expect that once I get into more custom stuff, like maze-solving, I'll want to be able to make it wait patiently until I tell it go.
I know I could do this using some kind of sensor (e.g. after program initialization, have the program wait for a touch on the whiskers or a flash of light); or leave the power switch at position 1 until I'm ready to go, push it to 2 then quickly hit reset; but is there anything slicker/less power consuming?
thanks,
Carl
Comments
BTW, some boards, like the BOE, have a three-way switch so that the servo headers remain unpowered unless the switch is all the way in the third position. That way, with the switch in the middle position, even if the program is running, nothing plugged into these headers gets activated.
-Phil
Ideally, what I would like is for the program to download, then on completion of the download (presumably some signal from the serial port tells the board that's happened?) for the processor to immediately go to the same state that it goes to when it executes an END command, rather than going to the run state. Pressing the RESET button would then cause the program to start running as normal.
Post Edited (sylvie369) : 11/22/2009 4:31:04 PM GMT
There have been programs that keep track of how many times the Stamp has been reset by using a location in EEPROM to keep a counter, but these programs can't tell the difference between a reset caused by a new download vs. a reset caused by power on or by pushing the reset button.
Typically, these programs have a DATA statement that initializes an EEPROM location to zero, then the first thing the program does is to read that location. If the value is zero, it's the first reset since the program was downloaded. The program normally increments the location before continuing, so it will be non-zero for all other resets. Read the BASIC Stamp Syntax and Reference Manual chapters on the DATA and READ statements for details on how to use the EEPROM for data storage.
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
I like that idea. And since I really don't need to count how many times the Stamp has been reset, I can just use one bit. If it's 0, set it to 1 and END. If it's 1, run the program.
And in fact I can do even better: If I toggle the bit on each run, I can use the Reset button as a "stop/go" button: The first time it runs after download, the program will set the bit to 1 and then END. Hit it again, it will see the 1, set it back to 0, and then run. Hit the Reset while it's running and it will see the 0, set it to 1, and END.
Ah.... but you CAN -- to wit:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
Post Edited (Zoot) : 11/22/2009 9:17:05 PM GMT
-Phil