アナログ入力のテスト(ジョイステック)

Dependencies:   TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
yueee_yt
Date:
Thu Dec 29 01:07:00 2011 +0000
Parent:
0:112b27ac26d5
Commit message:

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 112b27ac26d5 -r b24f69657abc main.cpp
--- a/main.cpp	Mon Dec 26 07:39:47 2011 +0000
+++ b/main.cpp	Thu Dec 29 01:07:00 2011 +0000
@@ -6,14 +6,11 @@
 AnalogIn y(p20);
 
 int main() {
-    float xx,yy;
     lcd.cls();
     lcd.printf("ADC TEST\n");
     while (1) {
         lcd.locate(0,1);
-        xx=(float)((int)(x.read()*100))/100.0;
-        yy=(float)((int)(y.read()*100))/100.0;
-        lcd.printf("x=%4.2f y=%4.2f",xx,yy);
+         lcd.printf("x=%4.2f y=%4.2f",x.read(),y.read());
         wait(0.1f);
     }
 }