@@ -45,21 +45,21 @@ when you plug in circuits and other devices via the pins.
45
45
Bleeps and Bloops
46
46
+++++++++++++++++
47
47
48
- The simplest thing we can attach to the device is a Piezo speaker . We're going
48
+ The simplest thing we can attach to the device is a Piezo buzzer . We're going
49
49
to use it for output.
50
50
51
- .. image :: piezo .jpg
51
+ .. image :: piezo_buzzer .jpg
52
52
53
53
These small devices play a high-pitched bleep when connected to a circuit. To
54
54
attach one to your BBC micro:bit you should attach crocodile clips to pin 0 and
55
55
GND (as shown below).
56
56
57
57
.. image :: pin0-gnd.png
58
58
59
- The wire from pin 0 should be attached to the positive connector on the speaker
59
+ The wire from pin 0 should be attached to the positive connector on the buzzer
60
60
and the wire from GND to the negative connector.
61
61
62
- The following program will cause the speaker to make a sound::
62
+ The following program will cause the buzzer to make a sound::
63
63
64
64
from microbit import *
65
65
@@ -80,12 +80,12 @@ Can you work out how this script works? Remember that ``1`` is "on" and ``0``
80
80
is "off" in the digital world.
81
81
82
82
The device is put into an infinite loop and immediately switches pin 0 on. This
83
- causes the speaker to emit a beep. While the speaker is beeping, the device
83
+ causes the buzzer to emit a beep. While the buzzer is beeping, the device
84
84
sleeps for twenty milliseconds and then switches pin 0 off. This gives the
85
85
effect of a short bleep. Finally, the device sleeps for 480 milliseconds before
86
86
looping back and starting all over again. This means you'll get two bleeps per
87
87
second (one every 500 milliseconds).
88
88
89
89
We've made a very simple metronome!
90
90
91
- .. footer :: The image of the pizeo speaker is CC BY-NC-SA 3.0 from https://www.sparkfun .com/products/7950
91
+ .. footer :: The image of the pizeo buzzer is CC BY-NC-SA 3.0 from https://www.flickr .com/photos/tronixstuff/4821350094
0 commit comments