Optional – Elenco XP&trade User Manual
Page 39
This program plays an ascending
sequence of notes for very short
durations, which combine to make
a cute sound. You can change the
110 to any whole number between
0 and 127.
This program plays a sequence of
sounds based on the random
command. You can change these
zeros to any whole numbers between
0 and 255. You will have lots of fun
seeing how the sounds change when
you change these values.
-38-
Optional:
The
Play
command produces a musical tune (in the
form of an electrical voltage) on output 2.
The
Wait
command tells the microcontroller to delay
before performing the next instruction.
The
Sound
command produces a sequence of musical
tones or noise sounds (in the form of electrical voltages)
on an output pin.
The
If
command makes decisions.
The
Random
command generates a “random”
sequence of numbers that isn’t really random.
Microcontrollers perform mathematics to generate
random numbers, so the sequence produced will be the
same each time unless the starting point is changed.
Details on how these commands work can be found
under the Help menu at Snap Circuits
®
XP
TM
.