Part 3: Application

In order to demonstrate that both drivers function, you are required to interface a potentiometer and an RGB LED to the SJOne board. The potentiometer ADC input shall control the duty cycle of the RGB LED pwm outputs. Note that an RGB LED has three input pins that you will connect to three different PWM output pins. You must use your own ADC and PWM drivers, as well as your own FreeRTOS task.

Extra credit can be earned with an interesting/cool/creative RGB output.

Requirements

Using your own ADC Driver, read input voltage from a potentiometer

Print the voltage reading every 1s.

Using your own PWM Driver, drive an RGB LED.

Print the duty cycle of all three RGB pins every 1s.

The PWM output to the RGB LED must be dependent on the ADC input from the potentiometer.

By varying the potentiometer, you should be able to see changes in the color of the RGB Led.

You don't need a periodic task for the PWM to work. Initialize the driver, set period and duty cycle. PWM will start generating pulses immediately. You can vary the duty cycle of PWM inside the ADC task.