User Tools

Site Tools


oak:tutorials:blink

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
oak:tutorials:blink [2016/03/22 13:56]
jwhendy added conclusion
oak:tutorials:blink [2016/03/23 16:26] (current)
jwhendy
Line 73: Line 73:
 This code tells the Oak that we will be using pin 1 as an output, and then loops over and over sending a ''​HIGH''​ signal to pin 1 (turns the LED on), waits 1 second, and then turns the LED off by sending a ''​LOW''​ signal. This code tells the Oak that we will be using pin 1 as an output, and then loops over and over sending a ''​HIGH''​ signal to pin 1 (turns the LED on), waits 1 second, and then turns the LED off by sending a ''​LOW''​ signal.
  
-You can find a template like this in the Arduino IDE under ''​File -> Examples -> Oak Examples -> Start''​. Otherwise, start a new sketch and copy/paste the above into your file. Make sure the port and board selections are correct and then upload the code (the button above the text window with a right arrow icon). You should see this in the message area at the bottom of the Arduino window:+You can find a template like this in the Arduino IDE under ''​File -> Examples -> Oak Examples -> Start''​. Otherwise, start a new sketch and copy/paste the above into your file. With your Oak plugged powered on, make sure the Arduino ​board selection is correctand then upload the code with the button above the text window with a right arrow icon
 + 
 +[[http://​digistump.com/​wiki/​_media/​oak/​tutorials/​upload.png|{{http://​digistump.com/​wiki/​_media/​oak/​tutorials/​upload.png?​300}}]] 
 + 
 +You should see this in the message area at the bottom of the Arduino window:
  
 <​code>​ <​code>​
Line 89: Line 93:
 [[http://​digistump.com/​wiki/​_media/​oak/​tutorials/​blink-simple.gif|{{oak:​tutorials:​blink-simple.gif?​300}}]] [[http://​digistump.com/​wiki/​_media/​oak/​tutorials/​blink-simple.gif|{{oak:​tutorials:​blink-simple.gif?​300}}]]
  
-===== Code: changing LED behavior ​=====+=== changing LED behavior ===
  
 Now that you have a general idea of how to turn a light on and off, what else could you do? How might you make the blink shorter or longer? What do you think this changed code might do? (Hint: compare the delay values after each step!) Now that you have a general idea of how to turn a light on and off, what else could you do? How might you make the blink shorter or longer? What do you think this changed code might do? (Hint: compare the delay values after each step!)
Line 116: Line 120:
 </​code>​ </​code>​
  
-With this code, the light will blink for a shorter time and stay off longer.+With this code, the light will blink for a shorter time and stay off longer. ​
  
 ===== Conclusion ===== ===== Conclusion =====
Line 126: Line 130:
   * uploading a sketch   * uploading a sketch
   * setting a pin as an ''​OUTPUT''​   * setting a pin as an ''​OUTPUT''​
-  * gain an understanding ​of ''​loop()'',​ which does something again and again+  * understanding ​the ''​loop()'' ​section, which does something again and again
   * sending a ''​HIGH''​ and ''​LOW''​ voltage to a pin   * sending a ''​HIGH''​ and ''​LOW''​ voltage to a pin
   * using ''​delay()''​ to affect the behavior of an LED   * using ''​delay()''​ to affect the behavior of an LED
  
 Keep your momentum going and take a look at the [[http://​digistump.com/​wiki/​oak/​tutorials/​leds|next tutorial]] which will get you started wiring up LED bulbs, resistors, and some more advanced coding! Keep your momentum going and take a look at the [[http://​digistump.com/​wiki/​oak/​tutorials/​leds|next tutorial]] which will get you started wiring up LED bulbs, resistors, and some more advanced coding!
oak/tutorials/blink.1458680164.txt.gz · Last modified: 2016/03/22 13:56 by jwhendy