Вы находитесь на странице: 1из 7

Laboratory Exercise 3

FLICKERING LED
Introduction:
A computer hardware and software company, project, and user
community that designs and manufactures 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 Gizduino and Arduino boards and software distribution by
anyone. Arduino and Gizduino boards are available commercially in
preassembled form, or as do-it-yourself kits.
The project's board designs use a variety of microprocessors and
controllers. These systems provide sets of digital and
analog input/output(I/O) pins that may be interfaced to various expansion
boards ("shields") and other circuits. The boards feature serial
communications interfaces, including Universal Serial Bus (USB) on some
models, for loading programs from personal computers. The microcontrollers
are mainly programmed using a dialect of features from the programming
languages C and C++. In addition to using traditional compiler toolchains,
the Arduino project provides an integrated development environment (IDE)
based on the Processing language project.

Objectives:
1. To be able to familiarize and differentiate the type of LEDS and how it
works.
2. To be able to make LED flickering.
3. To be able to know the importance of Resistors in a circuit.

Materials:
10 LEDS
Cables
330 Resistor
Arduino board
Computer/ Laptop with Arduino software installed
Breadboard
Procedure:
Part 1: Connecting Arduino to the computer
1. Open the Arduino IDE by clicking on the Arduino Icon (software).
2. Connect your Arduino to the computer using the USB cable.

3. Make sure you select the right board.


4. Then select the correct serial port.
Part 2: Compiling and Uploading file to the Arduino
1. Once you see your Arduino board is connected to your computer. Go
to the File menu -> New.
2. Then input this code.

3. Then click on the Sketch menu and check for any typos / errors
using verify button and Compile to the machine language if the
verification is successful.
4. If the above process is successful, you should see the message in
the status bar showing that the compilation is successful.

5. Now upload your program to the Arduino by clicking upload button


in the Sketch menu.

6. You might face some issues from step 3-5 if you have not selected a
correct board/serial port. So please make sure you went through the
part 1 carefully. Go to the Tools -> Serial Port -> COM number.
7. After checking the serial port, upload it again.

Part 3: Flickering LED

1. In the above Flicker code you see bunch of lines performing certain
operations. In our case, turning on and off an LED connected to the
Digital pin 11.
2. After declaring pin 11 to be your ledPin1, there is nothing to do in
the setup() function of your code.
3. The analogWrite() function that you will be using in the main loop of
your code requires two arguments.
4. Pick a random number between 100-255, then set LED to that
brightness then pick another random number between 10-150. Wait
for that amount of time (in ms).

5. Repeat int brightness; brightness = random(100, 256);


6. Before uploading your new code to the Arduino we have to make
sure that LED is connected to the Digital pin 11, if there is nothing
connected we dont have a way to see our result. Now, you have a
flickering LED controlled using an Arduino. Now, we can change the
LED flickering times by editing the time in the software.

delay (random(2));
// here we are asking Arduino to wait for 2ms before executing
the next instruction.
Now, try to change the delay times, for both on and off times,
and upload the code again. What did you notice?

Results and Discussion:


In this laboratory exercise is the same in the previous exercises the
blinking and fading, the different is that were going to make a normal led
lights into flickering by using arduino software. The steps or procedure on
how to install the software, the codes and how to compile and upload the
code were stated above, it is the same procedure in blinking and fading but
they are different in wirings. Then when we try to upload our code to the
arduino then it is successful, the light is flickering!
By uploading our first code it is flicker but not all the lights were flicker
because there are those selected pins only that who can do flickering and
these are 3, 5, 6,9,10, & 11 no more, no less. To execute more than 6 LED
bulbs to flicker you just have to connect in series those additional bulbs in
the allowable pins. We try to change different delay times same effect in
blinking and fading that if you input smaller value it will flicker slower. The
output that weve made is shown below.

References:
http://forum.arduino.cc/index.php?topic=7115.0
https://www.google.com.ph/url?
sa=t&rct=j&q=&esrc=s&source=web&cd=8&cad=rja&uact=8&ved=0ahUKEwiIqovi
1fjRAhVGWLwKHXFTBPcQFghLMAc&url=http%3A%2F%2Fwww.richardvannoy.info
%2Flab-
05.php&usg=AFQjCNFE2i1IYdeFfoLQyo075bnFE_JFWg&bvm=bv.146094739,d.dGc

Вам также может понравиться