Yasushi TAUCHI
/
Analog_test_1
アナログ入力のテスト(ジョイステック)
Diff: main.cpp
- Revision:
- 1:b24f69657abc
- Parent:
- 0:112b27ac26d5
--- 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); } }