P. 1
WAM 2.2 EduCourse

WAM 2.2 EduCourse

|Views: 3|Likes:
Published by Ivan Avramov

More info:

Published by: Ivan Avramov on Apr 05, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PPT, PDF, TXT or read online from Scribd
See more
See less

04/05/2013

pdf

text

original

www.parallax.

com 599 Menlo Drive Suite 100 Rocklin, CA 95765
Slide 1

Copyrights and Trademarks
This documentation is copyright 2004 by Parallax, Inc. By downloading or obtaining a printed copy of this documentation or software you agree that it is to be used exclusively with Parallax products. Any other uses are not permitted and may represent a violation of Parallax copyrights, legally punishable according to Federal copyright or intellectual property laws. Any duplication of this documentation for commercial uses is expressly prohibited by Parallax, Inc. Duplication for educational use is permitted subject to the following conditions: Parallax grants the user a conditional right to download, duplicate, and distribute this text without Parallax's permission. This right is based on the following conditions: the document, or any portion thereof, may not be duplicated for commercial use; it may be duplicated only for educational purposes when used solely in conjunction with Parallax products, and the user may recover from the student only the cost of duplication. BASIC Stamp, Stamps in Class, and Board of Education are registered trademarks of Parallax, Inc. If you decide to use the names BASIC Stamp, Stamps in Class, and/or Board of Education on your web page or in printed material, you must state that "BASIC Stamp is a registered trademark of Parallax, Inc.," "Stamps in Class is a registered trademark of Parallax, Inc.," and/or "Board of Education is a registered trademark of Parallax, Inc.," respectively, upon the first appearance of the trademark name. Other brand and product names are trademarks or registered trademarks of their respective holders.

Slide 2

Stamps In Class Curriculum

Cited in Further Investigation Sections

Slide 3

Stamps In Class Curriculum Cited in Further Investigation Sections Slide 4 .

com • BASIC Stamp Editor • Downloads  BASIC Stamp Software • What’s a Microcontroller • Documentation  Educational Curriculum •What’s a Microcontroller • Downloads  Educational Curriculum •BASIC Stamp Manual • Documentation  BASIC Stamp Documentation Slide 5 • BASIC Stamp Manual • Documentation  BASIC Stamp Excerpts from pages 9 and 7 .parallax.Chapter #1: Getting Started Parallax CD: • BASIC Stamp Editor • Software  BASIC Stamps  Windows… Parallax Website:www.

14 .Introduction How many microcontrollers did you use today? What’s a BASIC Stamp? For the Classroom BASIC Stamp and Board of Education BASIC Stamp HomeWork Board Slide 6 Excerpts from pages 1. 2. and 13.

Introduction Amazing inventions with the BASIC Stamp Excerpts from pages 3 .4 Slide 7 .

Powercell Alkaline Battery 0 101 11 1 100 000 0 01 010 10 00 0 1 1 Write a PBASIC program then download it to the BASIC Stamp 0 0 11 100 1 0 00 01 0 0 01 10 00 10 1 0 Plug BASIC Stamp into Board of Education (if it is not already plugged in). then connect serial cable and battery or power supply.Chapter #1: Getting Started Com 10101001 Powercell 10 Alkaline Battery 3 or 4 6-9VDC 15 14 Vdd 13 12 Red Black 9 Vdc Battery X4 Pwr X5 Vdd X3 P15 P14 P13 P12 P11 P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0 Vin Vss STA in MPS CLA SS TM 1 Sout Sin ATN Vss P0 P1 P2 P3 P4 P5 P6 P7 Vin Vss Rst Vdd P15 P14 P13 P12 P11 P10 P9 P8 Vss P0 P2 P4 P6 P8 P10 P12 P14 Vdd Vss P1 P3 P5 P7 P9 P11 P13 P15 Vin X1 U1 Reset X2 0 1 2 Board of Education © 2000-2003 2 www.stampsinclass.stampsinclass.com 1 Excerpts from pages 16-20 10 0 Connect serial cable to computer COM port. 6-9VDC 9 Vdc Battery Pwr in C STAM PS LASS TM 1 Sout Sin ATN Vss P0 P1 P2 P3 P4 P5 P6 P7 Vin Vss Rst Vdd P15 P14 P13 P12 P11 P10 P9 P8 Vss P0 P2 P4 P6 P8 P10 P12 P14 Vdd Vss P1 P3 P5 P7 P9 P11 P13 P15 Vin X1 U1 Reset 0 1 2 www.com Slide 8 .

5} DEBUG "Hello.Chapter #1: Getting Started ' What's a Microcontroller .FirstProgram.bs2 ' BASIC Stamp sends message to Debug Terminal. your BASIC Stamp!" END Enter this program Click the BASIC Stamp 2 Button Click the PBASIC 2.5 button Click the ‘Run’ button Run the BASIC Stamp Editor Software Excerpts from pages 18-22 Slide 9 . ' {$STAMP BS2} ' {$PBASIC 2. it's me.

Chapter #1: Getting Started The command: DEBUG "Hello.stampsinclass. it's me…" Causes the BASIC Stamp to send a message to the Computer Click the ‘Run’ button The Debug Terminal appears with a message sent by the BASIC Stamp 10101001 Powercell 10 Alkaline Battery 0 101 1 11 0 001 000 01 10 001 00 0 1 1 0 0 11 100 1 0 00 01 0 0 01 10 00 10 1 0 6-9VDC 15 14 Vdd 13 12 Red Black 9 Vdc Battery X4 Pwr X5 Vdd X3 P15 P14 P13 P12 P11 P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0 Vin Vss STAM in C PS LASS TM 1 Sout Sin ATN Vss P0 P1 P2 P3 P4 P5 P6 P7 Vin Vss Rst Vdd P15 P14 P13 P12 P11 P10 P9 P8 Vss P0 P2 P4 P6 P8 P10 P12 P14 Vdd Vss P1 P3 P5 P7 P9 P11 P13 P15 Vin X1 10 0 U1 Reset X2 0 1 2 Board of Education © 2000-2003 www.com Excerpts from pages 20. 23 Slide 10 .

it's me.5 directive DEBUG command END command ' What's a Microcontroller .5} DEBUG "Hello.bs2 ' BASIC Stamp sends message to Debug Terminal. your BASIC Stamp!" END Excerpts from pages 20-21.Chapter #1: Getting Started comment comment Stamp 2 directive PBASIC 2.FirstProgram. 27-28 Slide 11 . ' {$STAMP BS2} ' {$PBASIC 2.

SOUT SIN ATN VSS P0 P1 P2 P3 P4 P5 P6 P7 1 24 VIN VSS RES VDD (+5V) P15 P14 P13 P12 P11 P10 P9 P8 SOUT SIN ATN VSS P0 P1 P2 P3 P4 P5 P6 P7 1 24 VIN VSS RES VDD (+5V) P15 P14 P13 P12 P11 P10 P9 P8 2 3 4 5 6 7 BS2 Vdd Vss 23 22 21 20 19 18 2 3 4 5 6 7 BS2 Vdd Vss 23 22 21 20 19 18 8 9 17 16 8 9 17 16 10 11 15 14 10 11 15 14 12 13 12 13 BS2-IC BS2-IC Excerpts from pages 47-50 Slide 13 .Chapter #2: Lights on – Lights off BASIC Stamp – LED Circuit P14 470  LED Vdd X3 P15 P14 P13 P12 P11 P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0 X2 Vin Vss + LedOnOff.bs2 ' {$STAMP BS2} ' {$PBASIC 2.5} P14 470  Vss LED Vss DO HIGH 14 PAUSE 250 LOW 14 PAUSE 250 LOOP Next Step Write a PBASIC Program to make the BASIC Stamp Switch the LED circuit input between Vdd (5 V) and Vss (0 V).

then save a copy (to be modified) under a new name: LedOnOffTenTimes. save the original program. √ Run your modified program. √ Remember to save your modified program.Chapter #2: Lights on – Lights off Changing the program to make the LED flash on/off 10 times Before making any changes. Excerpts from page 54 END Slide 14 .5} counter VAR Byte FOR counter = 1 TO 10 DEBUG ? counter HIGH 14 PAUSE 500 LOW 14 PAUSE 500 NEXT DEBUG "All done!" √ Use the same circuit √ Replace DO and LOOP with the segments of code shown here.bs2 ' {$STAMP BS2} ' {$PBASIC 2.

√ Remember to save your modified program under a different name! Use FlashBothLeds.Chapter #2: Lights on – Lights off LED Test Circuit Parts (1) LED – Green (1) LED .Make both LEDs flash on/off BASIC Stamp – LED Circuit (Modified) Vdd X3 P15 P14 P13 P12 P11 P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0 X2 √ Open FlashLed. Do not take it apart before building the next circuit.bs2 FlashBothLeds.bs2 Vin Vss + + ' {$STAMP BS2} ' {$PBASIC 2.Yellow (2) Resistor – 470  (yellow-violet-brown) Next Step . Excerpts from pages 58-59 .bs2 √ Add two lines of code √ Run your modified program.5} DO HIGH 14 HIGH 15 PAUSE 250 LOW 14 LOW 15 PAUSE 250 LOOP Slide 15 P15 P15 P14 P14 470  470 470  470 LED LED Vss Vss Vss Vss LED LED Important: Leave this circuit on your board! This circuit is re-used in the next set of activities.

Pushbuttons LED Test Circuit Parts How the Pushbutton Works (1) Resistor – 220 Ω (red-red-brown) (1) Resistor – 10 kΩ (brown-black-orange) (1) Pushbutton . 4 2. 3 Pushbutton Circuit Vdd Vin Vss (2) Jumper wires Vdd Vdd X3 P15 P14 P13 P12 P11 P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0 X2 P3 P3 220  220  10 k 10 k Vss Vss Excerpts from pages 72. 4 2.Chapter #3: Digital Input .normally open 1. 4 2. 3 1. 3 1 2 4 3 1. 76 Slide 16 .

bs2 ' {$STAMP BS2} ' {$PBASIC 2.78 Slide 17 .Pushbuttons ReadPushbuttonState.Chapter #3: Digital Input .5} DO √ Follow instructions with checkmarks on page 78 How the Circuit and Program Work Vdd SOUT SIN ATN VSS P0 P1 P2 P3 P4 P5 P6 P7 1 24 VIN VSS RES VDD (+5V) P15 P14 P13 P12 P11 P10 P9 P8 Vdd 2 3 4 5 6 7 DEBUG ? IN3 PAUSE 250 10 k 220  BS2 23 22 21 20 19 1 0 18 8 9 17 16 10 11 15 14 10 k 220  LOOP Vss 12 13 BS2-IC Vss Vdd SOUT SIN ATN VSS P0 P1 P2 P3 P4 P5 P6 P7 1 24 VIN VSS RES VDD (+5V) P15 P14 P13 P12 P11 P10 P9 P8 Vdd SOUT SIN ATN VSS P0 P1 P2 P3 P4 P6 1 24 VIN VSS RES VDD (+5V) P15 P14 P13 P12 P11 P10 P9 P8 2 3 4 5 6 7 BS2 23 22 21 20 19 2 3 4 5 6 7 BS2 23 22 21 20 19 1 0 18 1 0 18 8 9 17 16 8 9 17 16 10 k 220  10 11 15 14 10 k 220  P5 10 11 15 14 12 13 P7 12 13 BS2-IC BS2-IC Vss Vss Excerpt from page 77 .

bs2 ' {$STAMP BS2} ' {$PBASIC 2.10 k Ω (brown-black-orange) (1) LED – any color (1) Resistor – 220 Ω (red-red-brown) (1) Resistor – 470 Ω (yellow-violet-brown) (2) Jumper wires √ Follow instructions with checkmarks on page 81 PushbuttonControlledLed.5} DO DEBUG ? IN3 IF (IN3 = 1) THEN HIGH 14 PAUSE 50 LOW 14 PAUSE 50 Pushbutton/LED Circuit P14 P14 470  470  Vss Vss Vdd Vdd LED LED Vdd X3 P15 P14 P13 P12 P11 P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0 X2 Vin Vss + ELSE PAUSE 100 ENDIF LOOP P3 P3 220 220  10 k 10 k Vss Vss Excerpts from pages 80-83 Slide 18 .Pushbuttons Pushbutton/LED Circuit Parts (1) Pushbutton – normally open (1) Resistor .Chapter #3: Digital Input .

5} DO DEBUG HOME DEBUG ? IN4 DEBUG ? IN3 IF (IN3 = 1) THEN HIGH 14 PAUSE 50 ELSEIF (IN4 = 1) THEN HIGH 15 PAUSE 50 LED Vss Vdd P4 220  P3 220  10 k 10 k Vdd (2) Pushbuttons – normally open (2) Resistors .bs2 √ Follow instructions on pages 83-87 Pushbutton/LED Circuit Parts ' {$STAMP BS2} ' {$PBASIC 2.10 kΩ (brown-black-orange) (2) Resistors – 470 Ω (yellow-violet-brown) (2) Resistors – 220 Ω (red-red-brown) (2) LEDs – any color P15 470  P14 Vdd X3 P15 P14 P13 P12 P11 P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0 X2 Vin Vss ++ 470  LED Vss ELSE PAUSE 50 ENDIF LOW 14 LOW 15 PAUSE 50 Vss Vss Excerpts from pages 83-87 LOOP Slide 19 .Pushbuttons PushbuttonControlOfTwoLeds.Chapter #3: Digital Input .

parallax.Chapter #4: Controlling Motion Important: Leave the P14 LED and pushbutton circuits on your board! These circuits are re-used in this set of activities. Servo Circuit P14 470  LED Servo Circuit Parts (1) Resistor – 470 Ω (yellow-violet-brown) (1) LED – any color (1) Servo (STD) 15 14 Vdd 13 12 Vin Vss P14 White Red Black Servo White Red Black X4 X5 Red Black Vdd X3 P15 P14 P13 P12 P11 P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0 X2 Vin Vss + Vss standard servo www.com Excerpts from page 107 Slide 20 .

parallax.com standard servo www.0 ms 2. 1000 pulse duration  2 s 1000  2000s  2. duration standard servo www.com Use 0 to 15 to select BASIC Stamp I/O pin P0 through P15 duration × 2 s = pulse duration 1.0 ms Vdd (5 V) Vss P14 470  LED P14 White Red Servo Vss (0 V) Black Excerpts from pages 113-114 Vss Slide 21 .com standard servo www.Chapter #4: Controlling Motion 10 o’clock 2 o’clock 12 o’clock PULSOUT pin.parallax.0 ms Vin 2.parallax.0 ms 1.5 ms Example: PULSOUT 14.

com 1.bs2 FOR counter = 1 TO 150 PULSOUT 14.parallax.0 ms ≈ 3 seconds Vss (0 V) 20 ms FOR counter = 1 TO 150 PULSOUT 14. 750 PAUSE 20 NEXT 1. 1000 PAUSE 20 NEXT 2.com 1.0 ms Vdd (5 V) standard servo www.0 ms Vdd (5 V) 2. 500 PAUSE 20 NEXT 1.parallax.Chapter #4: Controlling Motion Excerpts from Example Program: ServoTest.0 ms standard servo www.com ≈ 3 seconds Vss (0 V) 20 ms FOR COUNTER = 1 TO 150 PULSOUT 14.5 ms Vdd (5 V) standard servo www.parallax.5 ms Vss (0 V) ≈ 3 seconds 20 ms Excerpts from pages 115-118 Slide 22 .

bs2 DEBUG CLS. pg.Chapter #4: Controlling Motion √ Follow instructions from Activity #2. CR DEBUGIN DEC pulses DEBUG "Enter PULSOUT duration:". "Enter number of pulses:". 119-124 Excerpt from Example Program: ServoControlWithDebug.124 Slide 23 . CR DEBUGIN DEC duration Transmit windowpane Receive windowpane Excerpts from pages 119 .

CR.bs2 counter VAR Word Counter increments with FOR…NEXT loop.Chapter #4: Controlling Motion √ Follow instructions from Activity #3 pg. CR. As the pulse width changes. Position changing over time gives an apparent velocity. Excerpts from pages 125-128 Slide 24 . counter PAUSE 20 DEBUG DEC5 counter. so does the pulse width. the servo’s position updates. FOR counter = 1000 TO 500 STEP 10 PULSOUT 14. 125 – 128 Excerpts from Example Program: ServoVelocities. STEP value controls the rate at which counter increases FOR counter = 500 TO 1000 STEP 4 PULSOUT 14. CRSRUP NEXT Count down instead of up at a faster step rate. counter PAUSE 20 DEBUG DEC5 counter. CRSRUP NEXT As counter changes.

com 10 k 10 k Vss Vss Excerpts from pages 129 . √ If not. P14 470  LED Vin Vss P14 15 14 Vdd 13 12 White Red Black Servo White Red Black X4 X5 Red Black Vdd X3 P15 P14 P13 P12 P11 P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0 X2 Vin Vss Vss Vdd Vdd + P4 220  P3 220  standard servo www. build it now.parallax.130 Slide 25 .Chapter #4: Controlling Motion Extra Pushbutton Parts (2) Pushbuttons normally open (2) Resistors – 10 k (brown-black-orange) (2) Resistors – 220  (red-red-brown) (3) Jumper wires The pushbutton circuit should still be on your board.

bs2 DO IF IN3 = 1 THEN IF duration > 500 THEN duration = duration . duration PAUSE 10 DEBUG HOME. .Chapter #4: Controlling Motion Excerpt from: ServoControlWithPushbuttons.25 ENDIF ENDIF IF IN4 = 1 THEN IF duration < 1000 THEN duration = duration + 25 ENDIF ENDIF PULSOUT 14. " = duration" LOOP Excerpts from pages131-133 Slide 26 √ Follow instructions with checkmarks on page 132. DEC4 duration.

1 F 104 Dial Circuit Vin X3 Vss 0.bs2 Activity #3 p.bs2 Activity #4 p.01 µF (1) Potentiometer – 10 kΩ A A Pot 10 k 0.1 µF + + + W B A 10 k  k 10 Pot Pot W W Vss P15 P14 P13 P12 P11 P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0 X2 B B Excerpts from pages 149-156 X Slide 27 . 152 √ Have fun controlling the servo with the pot. √ Run ReadPotWithRcTime.1 µF 0.1 µF P7 220  nc (2) Jumper wires 103 0. √ Remember to leave the P14 LED and servo circuits connected. Dial Circuit Parts (1) Resistor – 220 Ω (red-red-brown) (1) Capacitor – 0.Chapter #5: Measuring Rotation Important – more info: √ Replace your pushbutton circuits with this dial circuit. √ NOTE: The pot must be firmly seated in its breadboard sockets. 149 √ Run ControlServoWithPot.

time VAR Word HIGH 7 PAUSE 100 RCTIME 7.bs2 √ Twist the potentiometer’s input shaft.bs2 ' {$STAMP BS2} ' {$PBASIC 2.bs2 ControlServoWithPot. time LOOP Excerpt from page 151-156 Slide 28 . 1. 1. Excerpt from: ReadPotWithRcTime. and make notes of the time values displayed by the Debug Terminal. time time = time + 330 PULSOUT 14. √ Your course guide will explain how to adjust the example program so that it works best with the pulsout command and gives your servo a range of motion that uses the potentiometer’s entire range of motion.5} time DO HIGH 7 PAUSE 10 RCTIME 7.Chapter #5: Measuring Rotation √ Run ReadPotWithRcTime.

Chapter #5: Measuring Rotation √ Run ReadPotWithRcTime.5} time DO HIGH 7 PAUSE 10 RCTIME 7.bs2 √ Twist the potentiometer’s input shaft. 1.bs2 ' {$STAMP BS2} ' {$PBASIC 2. and make notes of the time values displayed by the Debug Terminal. 1. Excerpt from: ReadPotWithRcTime. time time = time + 330 PULSOUT 14. time LOOP Excerpt from page 147 .148 Slide 29 .bs2 ControlServoWithPot. √ Your course guide will explain how to adjust the example program so that it works best with the pulsout command and gives your servo a range of motion that uses the potentiometer’s entire range of motion. time VAR Word HIGH 7 PAUSE 100 RCTIME 7.

Chapter #6: Digital Display Common Cathode Display Parts (8) Resistors – 1 kΩ (brown-black-red) (5) Jumper wires (1) 7-segment LED 10 9 8 7 6 G F A B 1 E 4 C 6 B 7 A 9 F 10 G 5 DP A F G E D C B LED’s 3 E D C DP 8 1 2 3 4 5 Common Cathode DP EDC GFAB 1 k P15 P14 P15 P14 P13 P12 P11 P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0 X2 P13 P12 P11 P10 P9 P8 E LED’s C DP G F A B X3 Vdd Vin Vss common Vss Excerpts from pages 166-7. 172-173 Slide 30 .

CR FOR pinCounter = 8 TO 15 DEBUG DEC2 pinCounter. "-------". CR HIGH pinCounter PAUSE 1000 LOW pinCounter NEXT Excerpts from pages 173-174 Common Cathode 10 9 8 7 6 G F A B P15 P14 P13 P12 P11 P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0 X2 X3 Vdd A F G E D E D C DP B Vin C Vss 1 2 3 4 5 √ Run the example program shown on this slide and compare to your predictions. CR.bs2 '{$STAMP BS2} '{$PBASIC 2.5} pinCounter VAR Nib DP EDC GFAB DEBUG "I/O Pin".Chapter #6: Digital Display √ Predict which segment will glow. Slide 31 Common Cathode . How long will each segment glow? In what order will they glow? SegmentTestWithHighLow.

Chapter #6: Digital Display √ Run the example program from this slide.5} OUTH = %00000000 DIRH = %11111111 ' BAFG. which in turn control the segments.bs2 '{$STAMP BS2} '{$PBASIC 2.CDE OUTH = %11010110 P15 P14 P13 P12 P11 P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0 X2 10 9 8 7 6 G F Common Cathode A B ' 3 Vdd F A B ' 2 Vin Vss E D ' 1 C 1 2 3 4 5 ' Digit: ' 0 P15 P14 P13 P12 P11 P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0 X2 E D G C DP Slide 32 . √ Make notes on how the OUTH and DIRH variables control the I/O pins. Excerpt from: DisplayDigits.CDE OUTH = %11100111 PAUSE 1000 OUTH = %10000100 PAUSE 1000 OUTH = %11010011 PAUSE 1000 OUTH = %11010110 PAUSE 1000 OUTH = %10110100 PAUSE 1000 Vdd X3 X3 Vin Vss OUTH = %00000000 DIRH = %11111111 Common Cathode ' 4 Excerpts from pages 174-178 ‘ BAFG.

%01110110. DEC2 index. BIN8 OUTH.bs2 Lookup tables are useful for many things. %11110110 ]. CR Excerpt from: DisplayDigitsWithLookup. " ". %11010011. %11010110. OUTH DEBUG " PAUSE 1000 NEXT ". %10110100. %11110111. [ %11100111. %10000100. %11000100. √ Make notes on how the LOOKUP command is used to place a predetermined sequence of bit patterns into the OUTH variable. Excerpts from pages 180-181 Slide 33 . %01110111.Chapter #6: Digital Display FOR index = 0 TO 9 LOOKUP index.

bs2 '{$STAMP BS2} '{$PBASIC 2.Chapter #8: Frequency and Sound √ Build the piezospeaker circuit.. 2000 DEBUG "Tone done.5 s Vin Vss f = 2000 Hz T = 1÷2000 s Piezospeaker Circuit Vdd X3 P9 P9 Vss Vss P15 P14 P13 P12 P11 P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0 X2 T + P9 Vss Excerpt from page 219-221 Slide 34 ..bs2 TestPiezoWithFreqout. √ Run TestPiezoWithFreqout." I/O pin = P9 duration = 1500 ms = 1.". 1500. CR FREQOUT 9.5} Piezospeaker Circuit Parts (2) Jumper wires (1) Piezoelectric speaker DEBUG "Tone sending.

140. 500. CR PAUSE 100 FREQOUT 9. 1500 PAUSE 500 FREQOUT 9."..".. frequency NEXT NEXT Excerpts from pages 222-223 Slide 35 . 500.". 30. CR PAUSE 100 FOR duration = 15 TO 1 STEP 1 FOR frequency = 2000 TO 2500 STEP 20 FREQOUT 9. 2400 FREQOUT 9.bs2 DEBUG "Alarm. 100.bs2 duration frequency VAR VAR Word Word √ Run ActionTones. 1500 PAUSE 500 DEBUG "Robot reply. CR PAUSE 100 FREQOUT 9. 2000 PAUSE 500 DEBUG "Hyperspace.. duration. 2800 FREQOUT 9.. 4200 FREQOUT 9.Chapter #8: Frequency and Sound Excerpts from: ActionTones... 200.

bs2 DEBUG "Frequency = 2000 + 2010". 2000. 3000 DEBUG "Frequency = 2000 + 3000". CR END Excerpt from page 225 . 4000. 2000. 4000. CR FREQOUT 9. CR FREQOUT 9. CR FREQOUT 9. 2000. 2000. 4000. CR FREQOUT 9. 4000.5} DEBUG "Frequency = 2000". 3000 + = DEBUG "Frequency = 2000 + 2001". 4000. 4000. 2003 DEBUG "Frequency = 2000 + 2005". 2002 DEBUG "Frequency = 2000 + 2003". 2001 DEBUG "Frequency = 2000 + 2002". 2000.226 Slide 36 . 2005 √ Run MixingTones. CR FREQOUT 9. 4000.Chapter #8: Frequency and Sound MixingTones. CR FREQOUT 9. 4000. 2000 DEBUG "Frequency = 3000".bs2 '{$STAMP BS2} '{$PBASIC 2. 2000. CR FREQOUT 9. CR FREQOUT 9. 2010 DEBUG "Done".

7 Slide 37 .2 1864.229 4186.".1319 FREQOUT 9. CR: FREQOUT 9.0 2960.500.9 1568.0 3729.Chapter #8: Frequency and Sound Excerpt from DoReMiFaSolLaTiDo.0 2793.5 2093.1396 FREQOUT 9.bs2 DEBUG "Mi.500.7 Frequencies in Music C 6 # or D 6 # or F 6 # or G 6 # or A 6 # or C 7 # or D 7 # or F 7 # or G 7 # or D 6 b E 6 b G 6 b A 6 b B 6 b D 7 b E 7 b G 7 b A 7 b B 7 b C6 D6 E6 F6 G6 A6 B6 C7 D7 E7 F7 G7 A7 B7 C8 Excerpts from pages 227 . CR: DEBUG "Fa.bs2 1046.7 1217.0 1174..500...5 1480.1 A 7 # or 1108.3 2637.5 2489.0 3322..0 3520.1568 ' E6 ' F6 ' G6 1244.3 3951.4 3136.0 1661.5 1396.0 1760.".0 1975.5 1318.0 2349.0 √ Run DoReMiFaSolLaTiDo. CR: DEBUG "Sol..".

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->