Assignment_05_IOT
Assignment_05_IOT
5 (Group B)
Title: Write a program using Arduino to control LED (One or more ON/OFF). Or Blinking
Code
After you build the circuit plug your Arduino board into your computer, start the Arduino
Software (IDE) and enter the code below. You may also load it from the menu
File/Examples/01.Basics/Blink . The first thing you do is to initialize LED_BUILTIN pin as an
output pin with the line
pinMode(LED_BUILTIN, OUTPUT);
In the main loop, you turn the LED on with the line:
digitalWrite(LED_BUILTIN, HIGH);
This supplies 5 volts to the LED anode. That creates a voltage difference across the pins of the
LED, and lights it up. Then you turn it off with the line:
digitalWrite(LED_BUILTIN, LOW);
That takes the LED_BUILTIN pin back to 0 volts, and turns the LED off. In between the on and the
off, you want enough time for a person to see the change, so the delay() commands tell the
board to do nothing for 1000 milliseconds, or one second. When you use the delay() command,
nothing else happens for that amount of time. Once you've understood the basic examples, check
out the BlinkWithoutDelay example to learn how to create a delay while doing other things.
Once you've understood this example, check out the DigitalReadSerial example to learn how
read a switch connected to the board.
------------------------------------------------------------------------------------------------------------------------
Conclusion: -
_____________________________________________________________________________________
___________________
_____________________________________________________________________________________
___________________
_____________________________________________________________________________________
___________________
_____________________________________________________________________________________
___________________
_____________________________________________________________________________________
___________________