trying to figure out simple code with BS2
Einstein1879
Posts: 2
in BASIC Stamp
Hello;
I was wondering if someone can look at the code i put together and help me with a problem. Basically, all I want to do is write in the code that when P15 senses 5 volts when I toggle P7 high it goes to the part of the code that initializes the Epic2. Here is what I have.
' {$STAMP BS2}
' {$PBASIC 2.5}
signal CON 15
OUTPUT signal
x VAR Bit
delay CON 1500
x =0
Main:
x =IN7
PAUSE delay
OUT15 =x
GOTO Main
EMIC_TX PIN 0 ' Serial output (connects to Emic 2 SIN)
EMIC_RX PIN 1 ' Serial input (connects to Emic 2 SOUT)
#SELECT $STAMP
#CASE BS2
T9600 CON 84
#ENDSELECT
EmicBaud CON T9600
Init:
SEROUT EMIC_TX, EmicBaud, [CR]
SEROUT EMIC_TX, EmicBaud, ["N0", CR]
SEROUT EMIC_TX, EmicBaud, ["W150",CR]
PAUSE 250
SEROUT EMIC_TX, EmicBaud, ["S", "Hello.", CR]
SERIN EMIC_RX, EmicBaud, [WAIT(":")]
PAUSE 700
END
If you can assist me with this, that would be great.
Best regards,
Javier
I was wondering if someone can look at the code i put together and help me with a problem. Basically, all I want to do is write in the code that when P15 senses 5 volts when I toggle P7 high it goes to the part of the code that initializes the Epic2. Here is what I have.
' {$STAMP BS2}
' {$PBASIC 2.5}
signal CON 15
OUTPUT signal
x VAR Bit
delay CON 1500
x =0
Main:
x =IN7
PAUSE delay
OUT15 =x
GOTO Main
EMIC_TX PIN 0 ' Serial output (connects to Emic 2 SIN)
EMIC_RX PIN 1 ' Serial input (connects to Emic 2 SOUT)
#SELECT $STAMP
#CASE BS2
T9600 CON 84
#ENDSELECT
EmicBaud CON T9600
Init:
SEROUT EMIC_TX, EmicBaud, [CR]
SEROUT EMIC_TX, EmicBaud, ["N0", CR]
SEROUT EMIC_TX, EmicBaud, ["W150",CR]
PAUSE 250
SEROUT EMIC_TX, EmicBaud, ["S", "Hello.", CR]
SERIN EMIC_RX, EmicBaud, [WAIT(":")]
PAUSE 700
END
If you can assist me with this, that would be great.
Best regards,
Javier
Comments
Thank you!!
Kudos Hal, your diligence, enthusiasm and excellence has not gone unnoticed!
I take my cues from the many wonderful people on this forum who all are very giving of their time and expertise. I am truly in awe of the vast amount of free information that is so eagerly given by all the gifted people here. I always look forward to all the wonderful treasures you are able to find and share with us.
Hal