Example using the Seeed Grove slider

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 
00002 #include "mbed.h"
00003 
00004 AnalogIn pot(A0);
00005 DigitalOut led(A1);
00006 
00007 int main (void)
00008 {
00009     float value = 0.0f;
00010 
00011     while(1) {
00012         value = pot;
00013         printf("Slide location %3.2f\n", value);
00014         wait(0.5f);
00015         led = !led;
00016     }
00017 }