Vous êtes sur la page 1sur 6

UNIVERSITY OF THE EAST

College of Engineering
ECE Department

ROBOTICS AND SENSOR TECHNOLOGY


NEC 515-1EC
Assignment No. 1

ARDUINO PROGRAMMING

Submitted by:
MAGTAGOB, IVY T.
20130125778

Submitted to:
ENGR. MARK ANTHONY ASEOCHE
PROFESSOR
1. Make a program to implement the following truth table.

Program:

Output:
Brief Description:

This program used three switches as an input and 4 LEDs as an output. Switch 1 indicate as SW1 at pin
4, Switch 2 indicate as SW2 at pin 5 and Switch 3 indicate as SW3 at pin6. The 4 LEDs are at pin 10, 11,
12 and 13. The output display will is based on the truth table.

2. Write a program that will perform the following procedure:


Activate the light sequence:

Program:

Output:
Brief Description:

This program used 8 LEDs as an output. The 8 LEDs are at pin 11, 12, 13, 54, 55, 56, 57, and 58. As
the program done uploading the output sequence was shown above with a delay of 1 second.

3. Write a program that will perform the following procedure:


a) When only sw1 is pressed, the RGB LED emits Violet color
b) When only sw2 is pressed, the RGB LED emits Orange color
c) When both sw1 and sw2 are pressed, the RGB LED emits Yellow color
d) When neither of the switches is pressed, the RGB LED emits White color

Output:
Brief Description:

This program used two switches as an input and RGB LED as an output. Switch 1 indicate as SW1 at pin 2 and
Switch 2 indicate as SW2 at pin 3. The RGB LED are at pin 5, 6 and 9 respectively. When SW1 is pressed, RGB
LED emits Violet Color. When SW2 is pressed, RGB LED emits Orange Color. When both SW1 and SW2 are
pressed, RGB LED emits Yellow Color. Else, RGB LED emits White Color.

4. Write a program that will perform the following procedure:


a) When only sw1 (PB.2) is closed, the display will be Name1 and Name2.
b) When only sw2 (PB.4) is closed, the display will be Name3 and Name4.
c) When both switches are closed, the display will be SN1 SN4
d) Otherwise, None
Output:

Brief Description:

This program used two switches as an input and Serial Monitor as an output. Switch 1 indicate as SW1 at pin
2 and Switch 2 indicate as SW2 at pin 3. When SW1 is pressed, the display on serial monitor will be IVY.
When SW2 is pressed, the display on serial monitor will be MAGTAGNOB. When both SW1 and SW2 are
pressed, the display on serial monitor will be 20130125778. Else, there is no output display.