This was an introduction to the module, in the lecture we were presented with a 'What is Arduino?' worksheet. On this sheet it had links to websites thats contained information ontghe Arduino programming language and basic tutorials. These links were:
We were instructed to create a simple circuit which involved a LED and of course the arduino board.
Here is some images of my working circuit with a video:
The code for this circuit was obtained from the arduino software examples (File - Sketchbook - Examples - Digital - Blink).
Here is the code used:
/*
* Blink
*
* The basic Arduino example. Turns on an LED on for one second,
* then off for one second, and so on... We use pin 13 because,
* depending on your Arduino board, it has either a built-in LED
* or a built-in resistor so that you need only an LED.
*
* http://www.arduino.cc/en/Tutorial/Blink
*/
int ledPin = 13; // LED connected to digital pin 13
void setup() // run once, when the sketch starts
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}
void loop() // run over and over again
{
digitalWrite(ledPin, HIGH); // sets the LED on
delay(1000); // waits for a second
digitalWrite(ledPin, LOW); // sets the LED off
delay(1000); // waits for a second
}
No comments:
Post a Comment