Shop OBEX P1 Docs P2 Docs Learn Events
Singing BoeBot — Parallax Forums

Singing BoeBot

ercoerco Posts: 20,259
edited 2012-07-15 14:32 in General Discussion
Here BoeBot drives in a circle, scanning the speaker back & forth while singing an improved version of Daisy. Shows that the BS2 can do other things while speaking. There are only brief pauses in servo management while the Stamp sends serial data bursts (9600 8N1) to the SP0-512 RoboVoice chip. Sensors could be monitored between speech bursts as well. Had to cheat a bit to fit the 28-pin IC plus an 8-pin LM386 amp in the 17-pin breadboard, but it works!

With a bit of tweaking, this could be Figure 8 contender...
' {$STAMP BS2}
' {$PBASIC 2.5}
' DAISY for RoboVoice sp0512 chip
' modified for updated chip on boebot
' servo scans and boebot does a left circle

INPUT 0     'speaking line from 512
OUTPUT 7    '9600 true 8N1 data to 512
aa:
GOSUB waitspeak
SEROUT 7,84,[CR,CR]   'initialize

W0=300          'W0   300-1000
B2=0           '  0=increasing to 1000   1= decreasing TO 300

main:
PAUSE 1500
SEROUT 7,84,["[V8] [S3] [E3]dayee [PA5] [PA5] [PA5] [PA5] [C3]zeeey [PA5] [PA5] [PA5] [PA5] [PA5] dayee [PA5] [PA5] [PA5] [PA5] [G2]zeee [PA5] [PA5] [PA5] [PA5] [PA5] [A2]give [B2]me [C3]ur [A2]annhnhnhn  [PA5]  [C3]ser [PA5] [G2]doooooo ",CR,CR]
GOSUB waitspeak
SEROUT 7,84,[" [D3]hyheem [PA5] [PA5] [PA5] [PA5] [G3]halff [PA5] [PA5] [PA5] [PA5] [PA5] [PA5] [E3]cray [PA5] [PA5] [PA5] [PA5]  [C3]zee  [PA5] [PA5] [PA5] [PA5]   [A2]all [B2]for [C3]thuh [D3]love [PA5] [PA5] [PA5] [E3]of [D3]youuu",CR,CR]
GOSUB waitspeak
SEROUT 7,84,["it [E3]won't be [D3]a [G3]stahee [PA5] [PA5] [E3]lish [D3]mar [C3]rijj",CR,CR]
GOSUB waitspeak
SEROUT 7,84,["[D3]i [PA5] [E3]caan't [PA5] [PA5] [C3]uh  [A2]ford [PA5] [PA5] [PA5] [PA5] [C3]uh [A2]kar [G2]rijj",CR,CR]
GOSUB waitspeak
SEROUT 7,84,["but [C3]you'll [PA5] [PA5] [E3]look [D3]sweet [PA5] [PA5] [PA5] [PA5] [G2]up [C3]on [PA5] [PA5] [E3] thuh [D3]seat [PA5] [E3]of [F3]a [G3]by [E3]sick [C3]kul [D3]bilt [PA5] [PA5] [PA5] [G2]for [C3]toooooo",CR,CR]
GOSUB waitspeak
SEROUT 7,84,[CR,CR]
GOTO main

waitspeak:
PAUSE 100
servo:IF B2=0 THEN W0=W0+10
IF B2=1 THEN W0=W0-10
IF W0=1000 THEN B2=1
IF W0=300 THEN B2=0
PULSOUT 14,W0
PULSOUT 12,740
PULSOUT 13,780
test:IF IN0=0 THEN finish
PAUSE 20
GOTO servo
finish:

RETURN

Comments

  • skylightskylight Posts: 1,915
    edited 2012-07-15 07:03
    Who said the Basic Stamp can't multitask! Great bit of programming erco
  • ercoerco Posts: 20,259
    edited 2012-07-15 14:32
    More offloading than multitasking, but using the 512 as a co-processor definitely lets the Stamp do more.
Sign In or Register to comment.