90 likes | 173 Views
Filling the Pause. Sound and Motion with the Boe-bot. Silent running. for x = 1 to limit pulsout left_servo, 850 pulsout right_servo,650 pause 20 next. Melodic running. for x = 1 to limit pulsout left_servo, 850 pulsout right_servo,650 freqout speaker, 20, myfreq next.
E N D
Filling the Pause Sound and Motion with the Boe-bot
Silent running for x = 1 to limit pulsout left_servo, 850 pulsout right_servo,650 pause 20 next
Melodic running for x = 1 to limit pulsout left_servo, 850 pulsout right_servo,650 freqout speaker, 20, myfreq next
Getting a beep -- I • Design a cycle • LED 1 on for 600 msec (27 loops) • LED 2 is off • LED 2 on for 600 msec (27 loops) • LED 1 is off
Getting a beep -- II • Add a counter myc = 0 for x = 1 to limit other stuff myc = myc + 1 if myc < 54 then eloop myc = 0 eloop: next
Getting a beep -- III • Make the transitions if myc < 27 then myc_ge27 low LED1 high LED2 goto myc_end myc_ge27: high LED1 low LED2 myc_end:
A more elaborate example • While backing up • Beep • Blink • Some code
Too many variables • Define “place holders” for local variables ‘ Local variables for subroutines t1 var word t2 var word • Rename these in subroutines ‘ Local variables for goforward tgx var t1.highbyte tgfreq var t2
A little bit about tone • Tempered vs. Natural tone • A code fragment