Rtos API example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 DigitalOut out(p5);
00004 #if defined(TARGET_LPC1114)
00005 AnalogIn in(p20);
00006 #else
00007 AnalogIn in(p19);
00008 #endif
00009 
00010 volatile float w, x, y, z;
00011 int main() {
00012     while(1) {
00013         z = x * y / w;
00014         printf("Hello World %d %f\n", out.read(), z);
00015         if(in > 0.5) {
00016             out = !out;
00017         }
00018     }
00019 }