the assignment this Build and Program a smart circuit using an Arduino UNO which reads a signal from an input component (Sensor, Switch, or variable resistor) to control an action component (Motor, Buzzer, LED...etc) using Code Blocks
and I wanted to work with RGB led, I searched on google and found that, https://create.arduino.cc/projecthub/gol73/innovation-lab-5-push-button-rgb-led-color-change-6f4453
So I decided to do it.
I used Tinkercad to simulate the circuit and prepare the code blocks, then coping the code text and run it on Arduino IDM.
connect the arduino to the laptop and run the code
I used tinkercad to design the citcuit
simulate the circuit to check if it works
define the inputs and the outputs of the circuit, wirte down the code
I searched for Counting codes, I foung one then modify it and try it.
after the code works, I recorded the process.
I connected wires to the breadbord and the arduino
uploaded the code
run the code.
click the button to check the code
tinkercad simulation
I asked the instructor to advice me with code and she told me to search about a specified code but i didn't find it firstbut I found similar one and it works.
I got stuck with the code cause I wanted it to count clicks and each no of counts with differnt color. but I couldn't found similar code
So , I worked with high and low as high with different colors and low with white light. Then, I found code works as each click with color. First click lights blue, second one lights green and third one lights red
practicing on tinkercad and arduino will help me to write code of my final project and simulate it on tinkercad to avoid trying it on real wtih possible accidents.
Waving hand