Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 2. Write a program that implements a simple color selector using the RGB LED Components: - 1x Joystick - 1x 10 k2 resistor (for
Part 2. Write a program that implements a simple color selector using the RGB LED Components: - 1x Joystick - 1x 10 k2 resistor (for joystick pushbutton) 1x RGB LED - 2x 220 resistors (for the LEDs) a. Connect RGB LED and joystick as follows: .. 3263TAL XFUTA TCSP O UNO . Arduino REST ANALOG IN 1222 fritzing The joystick is simply two potentiometers, one for the X axis and one for the Yaxis, set up as 0-5V voltage dividers. According to the diagram above, the x and y outputs are connected to ADC inputs 0 and 1. The joystick also has a pushbutton that we are using in part c. b. Write a program to use the joystick's displacement to gradually select the brightness (i.e., change the PWM duty cycle) of the Blue and Red LED. Green is not used in this circuit. i. Blue is controlled with the X axis of the joystick. ii. Red is controlled with the Y axis of the joystick. iii. When the joystick is centered, both LEDs are 50% on. When in top right position, both are fully on. In the lower left corner, both LEDs are off. c. Then edit the program. It should use the joystick's pushbutton to hold the LED color and print its blue and red color details to the Serial monitor. While the button is pushed, the color will not change (even if the joystick is moved), and the serial monitor will continuously print the color details
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started