ECE595 - Lab 3 Part 2 - Slider Potentiometer Program - TA

main.cpp

Committer:
priyank12p
Date:
2021-01-16
Revision:
2:adc51888ece5
Parent:
1:93e233c997ad

File content as of revision 2:adc51888ece5:

#include "mbed.h"

AnalogIn pot(A0);
DigitalOut led(A1);

int main (void) {
    float value = 0.0f;
    while(1) {
        value = pot;
        printf("Slide location %3.2f\n", value);
        wait(0.5f);
        led = !led;
    }
}