Question: Using Tinkercad Create the circuit below with the RGB led. 1 Write a program that allows the user to set the brightness of each of

Using Tinkercad Create the circuit below with the RGB led.

1 Write a program that allows the user to set the brightness of each of the RGB channels by using the rotation dial to control brightness and a push button to select the channel. For example, the operation of this program could be as follows.

User turns the dial to set the brightness of the red LED. The User pushes button 1 and the red brightness stays locked in. User turns the dial to set the brightness of the green LED.

The User pushes button 1 and the green brightness stays locked in.

User turns the dial to set the brightness of the blue LED.

If the user pushed button 1 and the blue brightness stays locked in.

At this point the brightness cannot change until the user hits button 1 again. Note:

The lights should stay on as you move from one colour to the next. The goal is to be able to make any colour. You should also use the serial monitor to display the value of each light.

Level 4: Modify the code from level three to incorporate a user option.

Ask the user which colour they would like to change.

Then use the rotation dial to change the brightness then use the button to store it in memory.

After the button is pressed the user will be asked again what colour they would like to modify.

Here's a breakdown of testing the code:

1. When code start rotation dial does nothing and light is off and a message appears once in the form "Which colour would you like to change? R G B"

2. If the user enters R then the rotation dial will be altering the brightness of the red LED, with the value being printed to the serial monitor.

3. Once the user hits the button a message will appear asking user to input next colour. At this point the rotation dial can no longer change the brightness of the red led.

4. Code will continue with two other colours (B and G) alternating between steps 2 and 3.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!