Next in this mBlock exploration for my class iBook is looking at how we can use multiple LED’s to create light patterns.
- solder LED’s to a common ground wire and an individual pin wire
- create blocks that turns the lights on and off in a sequence
- use variables and if statements to lessen the number of blocks needed to make the sequence work
- explore other patterns
Once created they will connect the black wire group to ground and the other wire to pins on the Uno. In my example on the left I am using pins 12-7. The task will be to turn each LED on and off in order. This is just extending the code we looked at in my last post. In my example I have added the variable duration to quickly change the time between turning lights off and on.
Students will look at the code for patterns. Can they create a variable to change pin number? Can they reset the this variable so it starts again at 12?
Finally they will create other patterns?
A solution using a decrementing pin variable.