basic stamp 2 about auto off program
HKfans
Posts: 6
i am use basic stamp 2 for my project
the project i have use
Parallax 2x16 Serial LCD (Non-Backlit)
PING))) Ultrasonic Sensor
BASIC Stamp 2 Module
Memsic 2125 Dual-axis Accelerometer
i want to ask auto-off program
When I pressed the ON, not by ANY button after a few minutes, it will AUTOOFF
HOW TO WIRTE THE PROGRAM TO DO THAT?
THANK YOU FOR HELP
the project i have use
Parallax 2x16 Serial LCD (Non-Backlit)
PING))) Ultrasonic Sensor
BASIC Stamp 2 Module
Memsic 2125 Dual-axis Accelerometer
i want to ask auto-off program
When I pressed the ON, not by ANY button after a few minutes, it will AUTOOFF
HOW TO WIRTE THE PROGRAM TO DO THAT?
THANK YOU FOR HELP
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
i only follow paralax doc to write the program
You will need to build some additional hardware to turn off the power to the display and the sensors. There is no "ready made" hardware. It's not difficult. It mostly consists of a PNP switching transistor like a 2N3906, a few resistors, and a capacitor. The Stamp uses a SLEEP statement to drop into a low power state (read the chapter on the SLEEP and NAP statements in the BASIC Stamp Syntax and Reference Manual).
It might be possible to provide power for the Accelerometer from a Stamp I/O pin, but the PING and the display require a little more than the Stamp could control directly. The limit is around 20mA.
Post Edited (Mike Green) : 3/15/2010 7:18:19 PM GMT
Post Edited (HKfans[noparse];)[/noparse] : 3/15/2010 7:41:40 PM GMT
' {$PBASIC 2.5}
Main:
LOW 0 ' turn LED on
STOP ' stop program
THAT'S MEAN ALL SENSOR AND LCD DISPLAY OFF?
Alternatively, if you only have a NO relay (like a reed relay), put that across your SCR (anode & cathode). To turn off the SCR, temporarily turn that NO relay on to short the SCR and it will stay off afterward.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."