Build upon app-board-Servo. Print servo readings, scaled to [0.0, 1.0], to LCD on mbed Application Board. Scale reading to [0 - 270] range of typical servo. Print servo angles to LCD on mbed Application Board.
Dependencies: C12832_lcd Servo mbed
Fork of app-board-Servo by
Diff: main.cpp
- Revision:
- 4:62b61875eab5
- Parent:
- 3:58ae2860725e
- Child:
- 5:d751707daaf7
--- a/main.cpp Tue Oct 08 09:54:53 2013 +0000 +++ b/main.cpp Tue Oct 08 10:21:50 2013 +0000 @@ -36,13 +36,23 @@ lcd.cls(); //Clear screen for new cycle lcd.locate(3,3); //Screen location - lcd.printf("pan |"); //Column heading - lcd.locate(40,3); //Screen location + lcd.printf("pan"); //Column heading + lcd.locate(33,3); //Screen location + lcd.printf("|"); //column seperator + lcd.locate(51,3); //Screen location lcd.printf("tilt"); //Column heading lcd.locate(3,12); //Screen location lcd.printf("%.2f\n",PANa); //Print PAN - lcd.locate(40,12); //Screen location + lcd.locate(33,12); //Screen location + lcd.printf("|"); //column seperator + lcd.locate(51,12); //Screen location lcd.printf("%.2f\n",TILTa); //Print TILT + lcd.locate(3,21); //Screen location + lcd.printf("%.2f\n",PANa*270); //Print PAN + lcd.locate(33,21); //Screen location + lcd.printf("|"); //column seperator + lcd.locate(51,21); //Screen location + lcd.printf("%.2f\n",TILTa*270); //Print TILT s1=p1; //Set PAN servo to PAN potentiometer reading s2=p2; //Set PAN servo to PAN potentiometer reading wait(0.1); //Wait for servos to make position