converting code between bs2p40 and bs1 rev-dx
markmcleod50
Posts: 27
I have been using a bs2p40 to get a simple circuit up and running but would like to know what major differences i will need to be aware of between code for bs2 and bs1...here is my code for the bs2
' {$STAMP BS2p}
' {$pbasic 2.5}
TIME VAR Word
DO
HIGH 8
PAUSE 100
RCTIME 8, 1, time
DEBUG HOME, "time = ", DEC5 time
IF TIME > 600 THEN HIGH 0: LOW 15
PAUSE 500
IF TIME = 600 THEN HIGH 0: LOW 15
PAUSE 500
IF TIME < 600 THEN HIGH 15: LOW 0
PAUSE 500
LOOP
This is for a sculpture project I am still working on....when the lights in a room are bright, the stamp will turn on an object, when the lights are dim, it will turn that object off and turn on another object. I used the pause function so the change wouldnt be harsh.
Also...I will be running power to the bs1rev-dx through two conductor wire at 9 volts (its a project with a basic stamp in a slot car, basically) one I/O will always be on to drive the motor of the slot car at 1.5 volts...
1. How can i control the voltage, drop it to 1.5 volts, to the motor...resistors?
2. One of the objects being controlled will be a 9 volt radioshack player....How can I up the voltage to 9 volts if the stamp only uses 5?
Thanks for all the help...I will post pics when it's done. Thanks for the help, Mark
' {$STAMP BS2p}
' {$pbasic 2.5}
TIME VAR Word
DO
HIGH 8
PAUSE 100
RCTIME 8, 1, time
DEBUG HOME, "time = ", DEC5 time
IF TIME > 600 THEN HIGH 0: LOW 15
PAUSE 500
IF TIME = 600 THEN HIGH 0: LOW 15
PAUSE 500
IF TIME < 600 THEN HIGH 15: LOW 0
PAUSE 500
LOOP
This is for a sculpture project I am still working on....when the lights in a room are bright, the stamp will turn on an object, when the lights are dim, it will turn that object off and turn on another object. I used the pause function so the change wouldnt be harsh.
Also...I will be running power to the bs1rev-dx through two conductor wire at 9 volts (its a project with a basic stamp in a slot car, basically) one I/O will always be on to drive the motor of the slot car at 1.5 volts...
1. How can i control the voltage, drop it to 1.5 volts, to the motor...resistors?
2. One of the objects being controlled will be a 9 volt radioshack player....How can I up the voltage to 9 volts if the stamp only uses 5?
Thanks for all the help...I will post pics when it's done. Thanks for the help, Mark
Comments
1. Convert VAR definition to SYMBOL time = W1
2. Change DO-LOOP to GOTO Label
3. Modify RCTIME circuit to match POT; update code for POT (see online help)
4. Change DEBUG line for BS1 (not as flexible as BS2 family)
5. PAUSE, HIGH, and LOW work the same, but you're limited to pins 0 - 7 for HIGH and LOW
6. Update IF-THEN instructions -- the BS1 is IF (condition) THEN Label
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Post Edited (Jon Williams) : 11/14/2004 4:40:37 AM GMT