foivos Hristou
/
FRDM_slide2fade
FRDM_slide2fade
Fork of FRDM_TSI by
Revision 6:06e5f77ba66e, committed 2014-10-07
- Comitter:
- foivosHrist
- Date:
- Tue Oct 07 23:38:55 2014 +0000
- Parent:
- 5:b44f5f02b879
- Commit message:
- FRDM_slide2fade
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r b44f5f02b879 -r 06e5f77ba66e main.cpp --- a/main.cpp Thu May 09 09:26:46 2013 +0000 +++ b/main.cpp Tue Oct 07 23:38:55 2014 +0000 @@ -1,12 +1,22 @@ #include "mbed.h" #include "TSISensor.h" + +Serial pc(USBTX,USBRX); + + int main(void) { PwmOut led(LED_GREEN); TSISensor tsi; + float percentage; + // uint8_t distance; while (true) { - led = 1.0 - tsi.readPercentage(); + percentage=tsi.readPercentage(); + //distance=tsi.readDistance(); + //pc.printf("distance= %d , percentage= %f %% \n",distance,percentage); + + led = 1.0 - percentage; wait(0.1); } } \ No newline at end of file