Learn Arduino Quickly for a test

Hi everyone,
I am a 16 year old Italian student who has just entered the world of Arduino for school. I have a test next week and I'm in really bad shape, do you have any methods to learn the code quickly? I enclose an exercise to make my level understood:

To build a circuit, at the first touch you have to turn on the red light, the second the green light, the third the yellow light and with the fourth turn them all on and off with the fade effect.
I used Google Translate to write this, sorry for any mistakes.

You posted in the wrong place. What you posted was a question not a tutorial so I have moved your post here.

What have you done so far? We can help you but most of us will not do your assignment for you, that is cheating.

Start off with the basic examples in the Arduino IDE.

I don't want to cheat but learn how to use the code well. We have done: resistors, buttons and LEDs.

Hello s4mtv

Take a view here to gain the knowledge about.

ty so much
Have a good day!

So you know how to wire them to the Arduino. In which case you probably also know how to read a button and how to switch a LED on and off.

Use a variable as a counter. Increment that counter on each button press. When the counter is 4, reset to 0.

Now you can test the counter and take action based on the value.

There are a few issues that you will or might encounter when reading the button

  • floating inputs
  • bounce
  • you want to increment the counter when the button becomes pressed, not when the button is pressed

Good luck with the test.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.