Arduino #1 — Getting started
After looking around on r/diy and having tons of “I could do that…” moments, I finally decided to get an Arduino! I’ve played around with the Raspberry Pi’s GPIO pins before but never really gave the Arduino a go.
I was trying to decide whether to get the Uno or Mega but settled for the Uno in the end, figured I didn’t need so many outputs. I got the board itself, a breadboard, a couple of LEDs, a multimeter and some jumper cables.



Making an LED blink
My first idea was to make a simple LED blink, it’s like the Hello World of hardware projects.
I wanted to connect the board’s 5V pin directly to the LED but remembered that you need a current limiting resistor to prevent the LED from burning out.

Ohm's Law:
R = [5V (input) - 2V (LED Vf)] / 20mA (desired LED current)
= 150ΩThe minimum resistance required was 150Ω and so I went with a 220Ω resistor. Wrote the required code and found out that the Arduino programming language is actually a subset of C/C++ and it’s pretty simple.
// Use pin 7
int led = 7;void setup() {
// Set pin to be output
pinMode(led, OUTPUT);
}void loop() {
// Set high then delay 500ms
digitalWrite(led, HIGH);
delay(500);// Set low then delay 500ms
digitalWrite(led, LOW);
delay(500);
}
Uploaded the code to the board and voila!

Did some measurements using the multimeter to make sure that my calculations were correct.


Then, I started reading about more controlling more LEDs and discovered shift registers and RTC chips. More to come!
