Filling%20the%20Pause - PowerPoint PPT Presentation

About This Presentation
Title:

Filling%20the%20Pause

Description:

Define 'place holders' for local variables. Local variables for subroutines. t1 var word ... A little bit about tone. Tempered vs. Natural tone. A code fragment ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 10
Provided by: rebecc2
Learn more at: https://www.cs.unca.edu
Category:
Tags: 20pause | 20the | filling

less

Transcript and Presenter's Notes

Title: Filling%20the%20Pause


1
Filling the Pause
  • Sound and Motion
  • with the Boe-bot

2
Silent running
  • for x 1 to limit
  • pulsout left_servo, 850
  • pulsout right_servo,650
  • pause 20
  • next

3
Melodic running
  • for x 1 to limit
  • pulsout left_servo, 850
  • pulsout right_servo,650
  • freqout speaker, 20, myfreq
  • next

4
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

5
Getting a beep -- II
  • Add a counter
  • myc 0
  • for x 1 to limit
  • other stuff
  • myc myc 1
  • if myc lt 54 then eloop
  • myc 0
  • eloop
  • next

6
Getting a beep -- III
  • Make the transitions
  • if myc lt 27 then myc_ge27
  • low LED1
  • high LED2
  • goto myc_end
  • myc_ge27
  • high LED1
  • low LED2
  • myc_end

7
A more elaborate example
  • While backing up
  • Beep
  • Blink
  • Some code

8
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

9
A little bit about tone
  • Tempered vs. Natural tone
  • A code fragment
Write a Comment
User Comments (0)
About PowerShow.com