Arduino UNO Activity: An Application & Tutorial in Using Arduino to Eight LED Lights | Part 2 – “ Continuous Turning On of Eight LED Lights, One By One - From LED 1 to LED 8 “

in #utopian-io7 years ago (edited)

Good day to all the readers! ^_^

Capture.JPG

Modern engineering life became quite more advance leading most of engineering activities involve with technology. There is no doubt that Arduino is one of the invented software and/or hardware which has been used by engineers and programmers nowadays. Arduino is an open source computer hardware and software company, project, and user community that designs and manufactures single-board microcontrollers and microcontroller kits for building digital devices and interactive objects that can sense and control objects in the physical world. The project's products are distributed as open-source hardware and software, which are licensed under the GNU Lesser General Public License (LGPL) or the GNU General Public License (GPL), permitting the manufacture of Arduino boards and software distribution by anyone. Arduino boards are available commercially in preassembled form, or as do-it-yourself (DIY) kits.

image.png

Code Explanation (What is pinMode? digitalWrite? )

What is pinMode?

Configures the specified pin to behave either as an input or an output. As of Arduino 1.0.1, it is possible to enable the internal pullup resistors with the mode INPUT_PULLUP. Additionally, the INPUT mode explicitly disables the internal pullups.


What are Digital Pins?

The pins on the Arduino can be configured as either inputs or outputs. This document explains the functioning of the pins in those modes. While the title of this document refers to digital pins, it is important to note that vast majority of Arduino (Atmega) analog pins, may be configured, and used, in exactly the same manner as digital pins.


What is digitalWrite?

Write a HIGH or a LOW value to a digital pin.
If the pin has been configured as an OUTPUT with pinMode(), its voltage will be set to the corresponding value: 5V (or 3.3V on 3.3V boards) for HIGH, 0V (ground) for LOW.

If the pin is configured as an INPUT, digitalWrite() will enable (HIGH) or disable (LOW) the internal pullup on the input pin. It is recommended to set the pinMode() to INPUT_PULLUP to enable the internal pull-up resistor. See the digital pins tutorial for more information.

If you do not set the pinMode() to OUTPUT, and connect an LED to a pin, when calling digitalWrite(HIGH), the LED may appear dim. Without explicitly setting pinMode(), digitalWrite() will have enabled the internal pull-up resistor, which acts like a large current-limiting resistor.


EXAMPLE CODE (FOR EXPLANATION)

Capture.JPG

For more information about Arduino, just click here.

What is a Resistor?

Resistor is a passive two-terminal electrical component that implements electrical resistance as a circuit element. In electronic circuits, resistors are used to reduce current flow, adjust signal levels, to divide voltages, bias active elements, and terminate transmission lines, among other uses. High-power resistors that can dissipate many watts of electrical power as heat may be used as part of motor controls, in power distribution systems, or as test loads for generators. Fixed resistors have resistances that only change slightly with temperature, time or operating voltage. Variable resistors can be used to adjust circuit elements (such as a volume control or a lamp dimmer), or as sensing devices for heat, light, humidity, force, or chemical activity.


Today is the second day in which I am able to use the Arduino Application and again, I realized its importance to engineering life nowadays. Using the said application sounds fun and challenging since if you are going to use it, you must have to analyze well the codes that should be used in order for the program to work well (brainstorming is a must) though it’s not that difficult to use.


Activity Name:

Continuous Turning On of Eight LED Lights, One By One - From LED 1 to LED 8 (Continuous Rotation)


Webp.net-gifmaker (1).gif

Capture3.JPG


Equipment Used:

  1. Eight Resistors
  2. One Breadboard
  3. Eight LED Lights
  4. Connecting Wires
  5. Analog Multitester
  6. Arduino UNO with USB Cable
  7. Laptop with Arduino Application

Summarized Activity Instructions:

  1. Prepare the equipment needed for the activity.
  2. Use eight (8) LED lights and eight (8) resistors only for the activity. Use the Analog Multitester to test if the LED lights are operational. (Note: Operational LED lights will produce light when the terminals are connected properly)
  3. With the breadboard provided, make a circuit involving the said eight (8) LED Lights and resistors which are connected to each other and corresponds to the objective of the activity.
  4. Make a program of the activity using the Arduino Application on the laptop and verify if the created program is working or ready for uploading to Arduino UNO. (Additional Information: Arduino Application has a verification/test button of the created program before running and using it to the circuit created in the breadboard. This is to make sure if the program works well to avoid errors or malfunctions of the system.)
  5. Connect the created circuit to Arduino UNO using the connecting wires. After which, connect the Arduino UNO to the laptop using the USB Cable.
  6. In the Arduino Application on the laptop, upload the created program to Arduino UNO and run the system.

What Resistor should I use? How many ohms?

The type of Resistor that will be used is Linear Resistor having a value of 1000 ohms.

Activity Codes

void setup()

{

pinMode (13, OUTPUT);
pinMode (12, OUTPUT);
pinMode (11, OUTPUT);
pinMode (10, OUTPUT);
pinMode (9, OUTPUT);
pinMode (8, OUTPUT);
pinMode (7, OUTPUT);
pinMode (6, OUTPUT);

}

void loop()

{

digitalWrite (13, HIGH);
delay (650);

digitalWrite (12, HIGH);
delay (600);

digitalWrite (11, HIGH);
delay (550);

digitalWrite (10, HIGH);
delay (500);

digitalWrite (9, HIGH);
delay (450);

digitalWrite (8, HIGH);
delay (400);

digitalWrite (7, HIGH);
delay (350);

digitalWrite (6, HIGH);
delay (300);

}


pinMode
Meaning
pinMode (13, OUTPUT);sets the digital pin 13 as output
pinMode (12, OUTPUT);sets the digital pin 12 as output
pinMode (11, OUTPUT);sets the digital pin 11 as output
pinMode (10, OUTPUT);sets the digital pin 10 as output
pinMode (9, OUTPUT);sets the digital pin 9 as output
pinMode (8, OUTPUT);sets the digital pin 8 as output
pinMode (7, OUTPUT);sets the digital pin 7 as output
pinMode (6, OUTPUT);sets the digital pin 6 as output

digitalWrite
Meaning
digitalWrite (13, HIGH) ;sets the digital pin 13 on
digitalWrite (12, HIGH) ;sets the digital pin 12 on
digitalWrite (11, HIGH) ;sets the digital pin 11 on
digitalWrite (10, HIGH) ;sets the digital pin 10 on
digitalWrite (9, HIGH) ;sets the digital pin 9 on
digitalWrite (8, HIGH) ;sets the digital pin 8 on
digitalWrite (7, HIGH) ;sets the digital pin 7 on
digitalWrite (6, HIGH) ;sets the digital pin 6 on

Delay
Meaning
delay (650);waits for 650 milliseconds
delay (600);waits for 600 milliseconds
delay (550);waits for 550 milliseconds
delay (500);waits for 550 milliseconds
delay (450);waits for 450 milliseconds
delay (400);waits for 400 milliseconds
delay (350);waits for 350 milliseconds
delay (330);waits for 300 milliseconds

THE CIRCUIT

IMG_20171125_123752.jpg

THE PROGRAM

Capture1.JPG

Capture2.JPG


Thank you visiting and reading the context ^_^



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Hey @rejzons I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

thank you for the approval @ruah :)

Great post, but you could explain better why to use a resistor of 1k and not another value.

thank you for the comment and suggestion @rpsreal :)

Coin Marketplace

STEEM 0.19
TRX 0.13
JST 0.030
BTC 62835.77
ETH 3392.04
USDT 1.00
SBD 2.50