ICP 1 - TondiToday/CSEE5590-IOT-Robotics GitHub Wiki
ICP 1
Teammate 1: Tonderai Kambarami
Teammate 2: Luis Guillermo Usseglio-Carbajal
Teammate 3: Kavin Kumar Arumugam
Introduction and Objective
The purpose of this ICP was to design a circuit using an Arduino, 3 LEDs and a switch to mimic a traffic light. Once the switch is clicked, the 3 LEDs (Red, Yellow and Green) go in a simple pattern of Red, Yellow, Green and continuously repeats.
Approaches and Methods
We used a bread board to connect the 3 LEDs and switch to the Arduino, all 4 components required resistors to adjust the amps from the 5V power source ( 270 Ohm resistors for the LEDs, and 10 KOhm resistors for the switch). Images of our set up and how we connect it to the Arduino can be found below.
We then used the Arduino IDE to code the logic for the LEDs. Altering the source code provided to us for this ICP. During the LOW (Off) switch state we set all the LEDs to a HIGH (on). Then once the switch state is changed to HIGH (on) we toggle through each of light on then off using delays and the digitalWrite method native to Arduino. We use the goto method to loop this process indefinitely. The snippet of code can be found below.
Results
The results of our test can be found in the short video linked to this Wiki documentation, the link is found below
Evaluation, Discussion and Conclusion
This ICP was very straight forward, and was more about familiarizing ourselves with the Arduino interface, the bread board and components, as well as the logic involved in manipulating the ICPs. If i were to change something with the ICP, it would be in the code, i would replace to goto statement with another method (goto is bad programming practice and was only used in this situation for its simplicity). I would also try and improve upon the logic so that the switch can start and stop the traffic light signal, however that would require changing the basic structure of the provided code and is beyond the scope of this exercise.