Example using the Seeed Grove slider

Dependencies:   mbed

main.cpp

Committer:
sam_grove
Date:
2014-08-15
Revision:
1:401629079a98
Parent:
0:46e460c85e27

File content as of revision 1:401629079a98:


#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;
    }
}