Question: how do I change my code to go output 0 - 3 3 0 0 mV whenver I turn my potentometer instead of outputting only

how do I change my code to go output 0-3300 mV whenver I turn my potentometer instead of outputting only the printf statement? Also what can i add to my code to make an led1 go from no light to fully on when turning the potentometer. Here is my code: #include "mbed.h"
AnalogIn analogInPin(A0); // Configure analog input GPIO pin using pin A0
int main(){
while(1){
// Read ADC input and convert to millivolts
float voltage = analogInPin.read()*3300.0f;
// Output voltage value to terminal without formatting
printf("Voltage: %f mV\r
", voltage);
wait(0.5); // Wait for 0.5 seconds
}

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!