Picture of Sparkfun RedBoard

Computer Club – Introduction to Arduino

On Tuesday, March 6, 2018, the Computer Club met formally beginning our Spring meetings.  Each member of the club worked with a SparkFun ReadBoard.  The RedBoard is programmed with Arduino and looks and acts very much like an Arduino Uno.  In fact, when uploading our programs to the RedBoard we tell the Arduino IDE the board is an UNO!

The programs we write are called Sketches.  For our first sketch, we used the example program called “Blink.”  Blink is a program that causes an LED to turn on and off.  The Blink program for Arduino is like a “Hello World” program we might write when trying out a new programming language.  Since there is no built-in display, we use the LED to show that we can make the Arduino “output” something.

Picture of Ardunio Sketch

Our programs for Arduino are called Sketches. Pictured is the sketch to cause an LED to blink.

After uploading our sketch and seeing the result, the blinking LED, we tried changing the delay line to see how that affects the rate of blinking.   We also saw that the LED is labeled with a 13 next to it.  This 13 represents the PIN number the LED is connected to.  This 13 is the same 13 on the headers along the sides of the RedBoard.  Each student was issued an additional LED to connect to PIN 13 and Ground to demonstrate that is was, in fact, the same on the onboard LED.  We also learned that when connecting LEDs we should use resistors to limit the flow of current through the LED which can shorten the life.

Finally, we took a look at the code at http://km2arc.kellenberg.org/introduction-to-the-redboard-and-programming/ , copied and pasted it into a new sketch.  This showed us how the serial monitor works,  demonstrated the difference between local and global variables and showed how the setup() and loop() functions operate.

 

mrcampbell / March 7, 2018 / Uncategorized