| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

BlinkyTwo

Page history last edited by WikiAdmin 8 years, 10 months ago

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.