Beeping The Horn (PXT)
There isn't much to this. There's a buzzer. It will play a high pitched tone whilst pin 14 is driven high. That means that you can't make your robot play a tune. Sad face. It's still has its uses though.
It's this simple.
pins.digitalWritePin(DigitalPin.P14, 1) basic.pause(250) pins.digitalWritePin(DigitalPin.P14, 0)
- The buzzer is pretty simple to use and integrate into other projects. Add it to any of the projects you have done so far.
- You can use the buzzer as a time indicator if you write your program around a loop with a sleep statement. Work out how to get the buzzer to do a short beep every second.
- Bump = buzz. Naturally.
- Morse code buzzing.
- Timely beeping synchronised with movements can be used to debug your programs as well as being a nice effect that you can add to a dancing robot program.