/* UNO_blink.ino
UNO ...
The Arduino UNO R3 has 14 digital input/output pins
pins 2 to 13 (pin13 has an indicator LED)
pin d0 (RX in) pin d1 (TX out)
6 pins have PWM show ~ indicator ~3, ~5, ~6, ~9, ~10, ~11
pins d10 (SS), d11 (MOSI), d12 (MISO), d13 (SCK) support SPI
analog input pins A4 (SDA) and A5 (SCL) support I2C (TWI)
there are additional arduino SDA and SCL pins
in the top row next to AREF pin
SS = Slave Select determines which device is being communicated
Each digital pin on the Arduino UNO R3 can supply up to 40mA
current. The input voltage should not exceed +5.5Volt!
Arduino UNO interrupts
"hardware interrupt" pins are digital pins 2 and 3
"pin change interrupts" are
port B digital pins 8 to 13
port C analog pins A0 to A5
port D digital pins 0 to 7
This is a simple program that needs no breadboard circuit:
Turns an LED on for one second, then off for one second.
Use it to "rest" the Arduino, only digitalOUT 13 is active.
Most Arduinos have an on-board LED you can control.
On the UNO, MEGA and NANO it is attached to digital pin 13,
LED_BUILTIN is set to the correct LED pin independent of
which board is used.
If you want to know what pin the on-board LED is connected
to on your Arduino model, check the Technical Specs of your
board at:
https://www.arduino.cc/en/Main/Products
also see:
https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink
LED types:
red (AlGaInP, wavelength = 624nm)
green (GaInN/GaN, wavelength = 525nm)
blue (GaN, wavelength = 467nm)
yellow (AlGaInP, wavelength = 590nm)
*/
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600);
Serial.print("LED_BUILTIN is pin ");
Serial.print(LED_BUILTIN); // shows LED_BUILTIN is pin 13
}
// the loop function runs over and over again forever
void loop() {
// turn the LED on (HIGH around +5V)
digitalWrite(LED_BUILTIN, HIGH);
// wait for 1000 milliseconds = 1 second
delay(1000);
// turn the LED off (LOW is about GND level)
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}