Boe bot with sound detection
Hello,
my friend and I are working on a boe bot for a school project.
We thought it would be cool to have the robot react to sound, a whistle.
With some assistance from my father, we've built a circuit.
The thing is, we've not sure how to code the program, we've searched the manual for clues but havn't found anything.
To test if it works, this is what we've come up with:
' {$STAMP BS2}
' {$PBASIC 2.5}
signal VAR Bit
DO
signal = IN1
DEBUG CRSRXY, 0, 1,
"signal = ",BIN1 signal
PAUSE 50
LOOP
If anyone has any suggestions to the code, please help.
Best regards
Axel Pelling
my friend and I are working on a boe bot for a school project.
We thought it would be cool to have the robot react to sound, a whistle.
With some assistance from my father, we've built a circuit.
The thing is, we've not sure how to code the program, we've searched the manual for clues but havn't found anything.
To test if it works, this is what we've come up with:
' {$STAMP BS2}
' {$PBASIC 2.5}
signal VAR Bit
DO
signal = IN1
DEBUG CRSRXY, 0, 1,
"signal = ",BIN1 signal
PAUSE 50
LOOP
If anyone has any suggestions to the code, please help.
Best regards
Axel Pelling
Comments
you can use a simple IF THEN statement to acomplish it
IF IN1 = 1 THEN
... place what you want to bot to do here ...
ENDIF
or
IF signal = 1 THEN
... same thing ...
ENDIF
hope to help
Amaral
The IN1 doesn't work.
It's supposed to show 'signal = 1' in the debug terminal when i blow the whistle, right? But it does not react.
thanks
Axel