Documentation – Week 3 – Learning how to simple Arduino

Objective

Turn on a LED with Arduino

General information:

  • Software used: Processing IDE for Arduino
  • Arduino UNO & cables & LEDs from Arduino kit

Steps:

1. Create the circuit

  • for this step, I chose not to use the breadboard and connects cables in between, but just to add the LED to the Arduino board pins
  • followed the schema from Figure 1 below – the schema is made with Fritzing – check: http://fritzing.org/home/
  • the shorter leg of the LED is connected to Ground and the longer led to pin 13 (for receiving energy)
Figure 1: Schema for connecting LED on Arduino board

Figure 1: Schema for connecting LED on Arduino board (made with Fritzing)

2. Program the Arduino

  • opened a new file in Processing IDE
  • on the menu on top I clicked on Open -> 01.Basics -> Blink
  • the blink mode appeared and I had to change the code for pinMode(pinNumber, OUTPUT) to pinMode(13, OUTPUT) accordingly to the circuit.
  • same for digitalWrite(pinMode, voltageLevel) -> digitalWrite(13, HIGH) under the loop() method.
Code for Blink LED on Arduino

Code for Blink LED on Arduino

Publicités
Publié dans Uncategorized
Web2PDF