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

  • Stop wasting time looking for files and revisions. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.

View
 

BlinkyBasic

Page history last edited by WikiAdmin 5 years, 5 months ago


The "ordinary" basic Blinky consists of something along the lines of...

 

   digitalWrite(LEDpin,HIGH);
   delay(200);
   digitalWrite(LEDpin,LOW);
   delay(200);

 

Of course, that is at the heart of something (slightly) bigger... but a LOT bigger for the complete novice's skill-set-so-far.

 

But, for a novice, it is accessible. And when that little LED is finally doing what it has been told to, it is a huge buzz, if your novice is a Right Thinking Person.

 

With NoviceGuard, the details of hooking up the LED is left for another day. Why make a novice learn two things at once?

 

With the optional, but highly recommended NovGrdCore library, the WHOLE program is....

 

#include <NovGrdCore.h>
NovGrdCore NGC;

void setup()
{
//yes, you have to have this... even though it is empty
}

void loop()
{
NGC.makeOuUR(1); 
delay(200);
NGC.makeOuUR(0);
delay(200);
}

 

"makeOuLR(1)"???? This, with NovGrd's help, means "make the Output at the Lower Right (high).

 

Note that with NovGrd, you don't have to stress your novices with the "joys" of the pinMode statements... nor is there the danger to your Arduino of your novices making mistakes there. Mistakes of that kind can permanently "fry" (render dead) Arduino pins.

 

=============

Don't forget to challenge your novices to try to adapt the program, once they have it running...

 

Can they make the blinking faster? Slower? Can they make the LED "on" for a short time, "off" for a long time?

 

Trivial "when you know how", of course... but they don't, yet, do they? There's a surprising amount of pleasure to be had in these small things.

 

Can they make the LED wink out "SOS" in Morse code?.... Three short flashes, three long, three short... and then a pause before the "SOS" is transmitted again.

 

Depending on circumstances, this might... or might not... be the time to introduce the idea of using subroutines. One for "dash", one for "dot". Then, using those, build "S" and "O" subroutines. Then loop becomes....

 

void loop()

{

S;O;S;

delay(400);

}

 

Not "necessary" at this point... but it illustrates that "Blinky" need not be a "nothing" exercise. You can do a lot, JUST with a winking LED. And NoviceGuard gives you four LEDs, in a square, to "play" with... and all you need, for "lots" of stuff is...

 

NGC.makeOuUR(0/1);
delay(xxx);

The  other LEDs are controlled with...wow!...
NGC.makeOuLR(0/1);
NGC.makeOuUL(0/1);
NGC.makeOuLL(0/1);

... Yeah... Lower Right, Upper Left, Lower Left. NoviceGuard/ NovGrdCore MAKE ARDUINO EASIER!

Comments (0)

You don't have permission to comment on this page.