In this lab, you will look through the various items in your kit, ask questions, and see how you can use some of the items in future projects. Refer to the Components section of the camp website for information about the components in your kit.
With the programming knowledge you have so far, you could try to play around with the many different LEDs or try using the active buzzer (speaker with the black potting on the underside). You could even try some of the other components with some code you find online or in the references I provided to see if you can determine how it works!
Add some randomness to your code! Use the functions described below. To randomly turn on/off an LED, use random to generate a value of either 0 or 1 (random(0,2)
).
randomSeed(seed)
randomSeed(analogRead(A5));
random(min, max)
min
: lower bound, inclusivemax
: upper bound, exclusiverandom(3,6)
– returns 3, 4, or 5random(0,4)
– returns 0, 1, 2, or 3
Whatever you want! If you are trying out a new circuit, I can help you double-check it before you power it on.
You will create a new sketch in Arduino Create for this lab just like your other lab exercises.