Skip to content

A simple interactive system of LEDs and switches using Arduino

Notifications You must be signed in to change notification settings

AlexEcoVis/light-up-the-place

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 

Repository files navigation

IDEA

The idea of this project is to use Arduino to build an interactive system of paired LEDs and switches, where LEDs of different colours are activated and shut down with the press of their corresponding switch. A simple circuit could be built to achieve the same result without Arduino, but since the switches in this project are momentary (i.e. need continuous compression), the system must be intelligent enough to "memorize" the momentary press of a switch.

MATERIALS

• Arduino UNO & Breadboard
• LEDs (x3)
• Momentary switches (x3)
• 220Ω resistors (x3)
• 10kΩ resistors (x3)
• Jumper wires

PROCESS

Board

The switches are connected to digital pins 2, 4 and 6, set as input pins. These pins are connected to ground with 10kΩ resistors. The LEDs are setup next to each switch and connected to pins 3, 5 and 7 respectively, set as output pins. They are connected to ground with 220Ω resistors.

Program (Code)

The loop includes the following conditions:
if green switch is pressed
  -> reverse green LED state
else if yellow switch is pressed
  -> reverse yellow LED state
else if red switch is pressed
  -> reverse red LED state

Following each switch press, a delay of 0.4 seconds is added to avoid running the loop again on the same press, which would otherwise cause the result to vary. The delay is added after the LED has been turned ON or OFF.

About

A simple interactive system of LEDs and switches using Arduino

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages