Arduino Tutorial
Here is the code to copy & paste into the Arduino Software:
void setup() {
// put your setup code here, to run once:
pinMode(13,OUTPUT); // 1
}
void loop() {
// put your main code here, to run repeatedly:
int delayTime = 1000; // 2
digitalWrite(13,HIGH); // 3
delay(delayTime); // 4
digitalWrite(13,LOW);
delay(delayTime);
}
/* Try it:
* 2 - Try changing the number here, see what happens if you make it bigger or smaller
* See if you can program the RedBoard to make the LED blink "SOS" in morse code (dot dot dot line line line dot dot dot)
* Hint: copy and paste sections of code so you don't have to retype everything
*/
/* What's actually happening?
* 1 - This is taking a port on the RedBoard and specifying whether it wants the port to GIVE a command (input) or RECEIVE a command (output)
* 2 - This is taking a random word, and assigning a number to it. So when I reference the word later on, the computer knows I am refering to a number
* Think of it as I take a box and write the words "delayTime" on it then put the number 1000 in it, when I use the words later, the computer takes the number out of the box to use
* 3 - This line specifies how much power should be flowing through the port, HIGH means a lot of power, LOW means no power
* 4 - Delay stops the code for a variable amount of time, the input is read in miliseconds
*/