Shop OBEX P1 Docs P2 Docs Learn Events
Boe bot with sound detection — Parallax Forums

Boe bot with sound detection

axelpellingaxelpelling Posts: 2
edited 2009-02-06 16:52 in BASIC Stamp
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

Comments

  • AmaralAmaral Posts: 176
    edited 2009-02-06 16:40
    Ok .. please tell us what you want to do with your incomming bit .

    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
  • axelpellingaxelpelling Posts: 2
    edited 2009-02-06 16:48
    yeah, we've already tried using if, that's not the problem.
    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
  • AmaralAmaral Posts: 176
    edited 2009-02-06 16:52
    ok .. can you give us the schematics of your circuit ? and parts
Sign In or Register to comment.