Wednesday 12 September 2018

Arduino UNO - Blink LED

Let us try a very simple program to control a LED via a C program.

Requirements:
1. Arduino UNO
2. LED bulb
3 Arduino IDE

Arduino UNO
uses a ATmega328P microchip which is a 8-bit AVR RISC-based microcontroller with
  • 32KB ISP flash memory with read-while-write capabilities
  • 1024B EEPROM, 2KB SRAM
  • 23 general purpose I/O lines
  • 32 general purpose working registers
  • 3flexible timer/counters with compare modes,
  • internal and external interrupts
  • serial programmable USART(Universal Synchronous/Asynchronous Receiver/Transmitter)
  • a byte-oriented 2-wire serial interface
  • SPI serial port.
  • a 6-channel 10-bit A/D converter (8-channels in TQFP and QFN/MLF packages).
  • a programmable watchdog timer with internal oscillator.
  • 5 software selectable power saving modes. 
  • device operates between 1.8-5.5 volts.

LED Bulb



Arduino IDE
  • Install the Arduino IDE on your PC. You will get the Setup for Arduino here
    (download size 178MB) [ Version 1.8.7 ]
    https://www.arduino.cc/en/Main/Software
Arduino IDE comes with few working sample codes. Of which we will be using one for our 1st simple tutorial.

STEPS:
1. Open Arduino IDE
2. Goto > File > Examples > 01. Basics > Blink
3. This opens the Blink LED Sample code as shown in image below.



4. Connect your Arduino UNO to PC via USB cable.
5. Connect a LED bulb with positive end to PIN 13, & negative end to ground PIN GND
    ( in LED  bulb the long end is positive & short end is negative.)
6. Now click the VERIFY button on Arduino IDE. This will build the code & check for errors if any.
7. Now click UPLOAD button on Arduino IDE. This will burn the code on to your Arduino UNO.
8. You will see long glow at TX , RX LED when your code is uploading.
9. Once done immediately your code will start executing. You will be able to see the LED attached to pin 13 toggle on/off with a delay of 1 second.





No comments:

Post a Comment