![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
アナログ入力のテスト(ジョイステック)
main.cpp@1:b24f69657abc, 2011-12-29 (annotated)
- Committer:
- yueee_yt
- Date:
- Thu Dec 29 01:07:00 2011 +0000
- Revision:
- 1:b24f69657abc
- Parent:
- 0:112b27ac26d5
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yueee_yt | 0:112b27ac26d5 | 1 | #include "mbed.h" |
yueee_yt | 0:112b27ac26d5 | 2 | #include "TextLCD.h" |
yueee_yt | 0:112b27ac26d5 | 3 | |
yueee_yt | 0:112b27ac26d5 | 4 | TextLCD lcd(p24, p26, p27, p28, p29, p30); // rs, e, d4-d7 |
yueee_yt | 0:112b27ac26d5 | 5 | AnalogIn x(p19); |
yueee_yt | 0:112b27ac26d5 | 6 | AnalogIn y(p20); |
yueee_yt | 0:112b27ac26d5 | 7 | |
yueee_yt | 0:112b27ac26d5 | 8 | int main() { |
yueee_yt | 0:112b27ac26d5 | 9 | lcd.cls(); |
yueee_yt | 0:112b27ac26d5 | 10 | lcd.printf("ADC TEST\n"); |
yueee_yt | 0:112b27ac26d5 | 11 | while (1) { |
yueee_yt | 0:112b27ac26d5 | 12 | lcd.locate(0,1); |
yueee_yt | 1:b24f69657abc | 13 | lcd.printf("x=%4.2f y=%4.2f",x.read(),y.read()); |
yueee_yt | 0:112b27ac26d5 | 14 | wait(0.1f); |
yueee_yt | 0:112b27ac26d5 | 15 | } |
yueee_yt | 0:112b27ac26d5 | 16 | } |