Blinky Two follows on from BlinkyBasic.
In BlinkyBasic, users learned how to turn the LEDs on and off. They made a start with the world of "output".
BlinkyTwo brings "input" into their skill set.
Now your users need to master the Arduino "if" command.
The following could be extended so that any of the buttons "does something".
It could also be written far more elegantly, if your users are ready for subroutines.
#include <NovGrdCore.h>
NovGrdCore NGC;
void setup()
{
//yes, you have to have this... even though it is empty
}
void loop()
{
if (boInHigh(0))
{
NGC.makeOuUL(1);
delay(200);
NGC.makeOuUL(0);
delay(200);
}
if (boInHigh(2))
{
NGC.makeOuLL(1);
delay(50);
NGC.makeOuLL(0);
delay(50);
}
}//end of loop
What will that do?
Nothing! Until someone presses either the upper left button (button "0") or the lower left button (button "2")
As long as one of them is down, the upper left or lower left LED will flash.
Again... this is just one of MANY variations upon a theme which can be "played" with until your novices are "bored", and want to move on.
Comments (0)
You don't have permission to comment on this page.