variables/program resetting after serin command
when I have the attached program running on my stamp and I send successive commands to the stamp via the serin command it seems to reset everything to off (like a reset).· If I uncomment the "goto startflash" line then the program just runs the "startflash" routine anytime anything is sent down the serial line, and then the other commands are ignored.
Any information will be greatly appreciated.
Thanks,
Eric
Any information will be greatly appreciated.
Thanks,
Eric
bs2
![](/plugins/FileUpload/images/file.png)
994B
Comments
when I send "65444" down the line it will turn on the irled pin for me(the IR LED turns on)
If I then send another "65444" the IR LED blinks
If I send some number less than 65000 the program correctly goes and blinks the white LED for the correct duration, but turns off the IR LED first
again any help will be greatly appreciated.
Thanks
Instead of using GOTO, try using GOSUB instead. Make sure you put a return statement at the end of each subroutine. This will return program flow back to the point of departure. Also, if TOP is intended to loop, you can nest the contents in a DO..LOOP contruct, instead of GOTO TOP.
Is the green LED on the STAMP going dim or pulsing? That is a sure sign of too much current being drawn by the circuit.
1. Perhaps your battery is low
2. You are drawing too much current through the LED's , try 1k resistors to just to test
3. Perhaps you have a short in the wiring.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!