Sparkfun Analog Joystick Test Program
Dependencies: 4DGL-uLCD-SE SparkfunAnalogJoystick mbed
Fork of Lab4 by
Revision 2:b5e0e6138548, committed 2015-03-08
- Comitter:
- happinesstaker
- Date:
- Sun Mar 08 21:17:03 2015 +0000
- Parent:
- 1:9d61fc8d0615
- Commit message:
- y position on screen: upper-->small y, bottom-->large y
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 9d61fc8d0615 -r b5e0e6138548 main.cpp --- a/main.cpp Sun Mar 08 05:44:22 2015 +0000 +++ b/main.cpp Sun Mar 08 21:17:03 2015 +0000 @@ -27,9 +27,10 @@ float angle=joysttick.angle(); float x=distance*cos(angle*M_PI/180)*40; float y=distance*sin(angle*M_PI/180)*40; + printf("y: %f\n\r\n", y); lcd.circle(60, 60, 40, WHITE); - lcd.line(60, 60, 60+lastx, 60+lasty, BLACK); - lcd.line(60, 60, 60+x, 60+y, WHITE); + lcd.line(60, 60, 60+lastx, 60-lasty, BLACK); + lcd.line(60, 60, 60+x, 60-y, WHITE); lastx=x; lasty=y; wait(0.1);