LED- A light-emittingdiodeA light-emitting diode (LED) is a semiconductor device that emits light when anelectric current flows through it.LEDs allow the current to flow in the forward direction and blocks the current in thereverse direction.LEDs have a wide range of applications ranging from your mobile phone to largeadvertising billboards. They mostly find applications in devices that show the timeand display different types of data.
3.
Sketches are compiledby avr-gcc / avr-g++1. avr-gcc:It converts high-level C code into machine code that the microcontroller can execute.2. avr-g++:It compiles C++ code into machine code for the AVR architectureAvr microcontrollers:It is named in the honor of its developers, Alf-Egil Bogen and Vegard Wollan– It is based on C/C++ programming language• So, the program syntax is almost similar to C/C++◦ – Supported data types◦ – Variables◦ – Constants◦ – Control structure◦ – Looping structure◦ – Arrays◦ – Strings◦ – Function
6.
A sketch consistsof two mandatory functions:• setup( ) -- it is executed once• loop( ) -- it is executed repeatedlySetup( ) is used for• initialization of serial communication• defining pinMode• declaring variablesLoop( ) is used for• writing the main code which has to execute continuously.• e.g. reading inputs from the sensors, triggering outputs to• the external device, etcpinMode (pin, mode) – It configures the specified pin to behave either as input or as output– By default the digital pins in Arduino function as input.– pin: is the number of the pin whose mode needs to be set– mode: can be INPUT, OUTPUT, INPUT_PULLUP.
7.
digitalWrite(pin, value)– Usedfor output by using the LOW/HIGH logic level(i.e. 0V / 5V)– value: LOW / HIGHdelay(ms) – Pause the program for the amount of time(in millisecond) specified by ms