Answered step by step
Verified Expert Solution
Question
1 Approved Answer
this is done in arduino Write a program to turn on a LED while the button is pressed. Switch A5 should control the Red LED,
this is done in arduino
Write a program to turn on a LED while the button is pressed. Switch A5 should control the Red LED, switch A4 the Green, and switch A3 the Blue By pressing combinations of buttons, you should be able to create 8 different colors on the LED: Black, Red, Green, Blue, Magenta, Cyan, Yellow, and White, based on the color table in Arduino Lab 1 The buttons are connected to PORTC as follows Port C bit c5 C4 C3 Button Value when NOT pressed A5 (leftmost) A4 A3 (rightmost) Note that when the button is NOT pressed, the value of that bit on the port is 1. When the button is pressed, it is zero. Each of these bits on PORTC should be set to an input, by writing a 0 into bits 3,4,5 of DDRC. These bits of PORTC may then be read via PINC. You may refer to Arduino Lab 1 for more info on DDRx, PORTx, and PINx. Also refer to Arduino Lab 1 (or your code for lab 1) for info on which bit of PORTB controls which color LEDStep 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