Question: Assignment: Complete Lab 1D - LED PWM Brightness with small alteration. See Potentiometer Basics.pdf a) For Project 4.1, setup a potentiometer range of 0

Assignment: Complete Lab 1D - LED PWM Brightness with small alteration. See

Assignment: Complete Lab 1D - LED PWM Brightness with small alteration. See Potentiometer Basics.pdf a) For Project 4.1, setup a potentiometer range of 0 to Vcc-5V as your external control input to adjust turning on each LED per its individual PWM setting. Therefore, adjust your code and set the thresholds below coming from your analog pot reading (ANALOG_POT_READING) with the following criteria: i. ii. iii. iv. ANALOG_POT_READING 0.25*Vcc, turn on Pin1 duty cycle 2% LED only. 0.25*Vcc ANALOG POT_READING 0.5*Vcc, turn on Pin2 duty cycle 10% LED while leaving Pin1 2% LED still on. 0.5*Vcc ANALOG_POT_READING 0.75*Vcc, turn on Pin3 50% LED while leaving Pin2 10% and Pin1 2% LED still on. 0.75*Vcc ANALOG POT_READING, turn on all LEDs (Pins 1-4). b) For Project 4.2, perform similar to above in setting up a potentiometer range of 0 to Vcc=5V as your external control input to adjust the "breathing" of an LED instead of the incremental For Loop for variable i of a 8 bit number (0-255). Therefore, perform the following: i. Remove the For Loop statements and have variable i equal to the pot reading (ANALOG_POT_READING) to adjust the values from 0 to 255 to the analogWrite() command, which should adjust your LED brightness while continuously operating your pot.

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 Mechanical Engineering Questions!