Can someone please help me?

I'm in a doctoral program at an art college, and my professor assigned me this project. It seems like my professor, who has an engineering background in media arts, assigned this task. I'm not sure how to proceed. Could you help me?

The task involves attaching LEDs in red, yellow, and blue, along with a switch, to a board. When the switch isn't pressed, the blue LED should light up. When the switch is pressed, the yellow LED should gradually light up and then change to red.

'digitalwrite-read', 'analogwrite-read','if' must be used.

I'd appreciate your assistance.

Welcome to the forum

You started a topic in the Uncategorised category of the forum

Your topic has been moved to a relevant category. Please be careful in future when deciding where to start new topics

I'm sorry, I didn't know how to write properly as it's my first time. I'll be more careful from now on.

Connect to diagonal corners of the switch.

The typical momentary button will work fine this way - the metal legs going through (and being thus connected)

image
(from wokwi)

So if you plug the button across the central rail of the breadboard, the 2 pins on one side are right to use.

That being said, in case of doubt, connecting diagonally across the button always work and you don't need to think about :slight_smile:


@h-lim we suppose your teacher gave you this assignment so that you learn something about the Arduino world, programming etc... So we won't do your homework as you would not learn anything.

What's your background with C++ and basic electonics? Do you have a class on this?

I think looking up info on the following could be usefull

  • reading buttons
  • loops
  • LED brightness using analogueWrite and PWM (Pulse Width Modulation)

And if you want to get fancy, gamma correction on LED intensity.

Good luck!

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