Datasheet

Table Of Contents
23
revolution
(c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.1 04/10
BOT120.PMD
BOT120 PICAXE-20X2 MICROBOT
Programming Example 4 – Piezo Sounder
Your Microbot motherboard has a piezo sounder connected to output
pin B.2 which can be used to play a variety of tunes and sounds.
The following program will play the “Happy Birthday” tune whenever the
push button (input pin C.6) on the motherboard is pushed.
Sample Logicator Flowchart File:
BOT120 PIEZO TEST1.PLF
The following program will make a two-tone beep whenever the push
button (input pin C.6) on the motherboard is pushed.
Sample Logicator Flowchart File:
BOT120 PIEZO TEST2.PLF
Sample BASIC File:
BOT120 PIEZO TEST1.BAS
main:
if pinC.6 = 1 then
play B.2,0
end if
goto main
Sample BASIC File:
BOT120 PIEZO TEST2.BAS
main:
if pinC.6 = 1 then
sound B.2,(50,100,100,100)
end if
goto main