The intent of this project is to use and learn, inverse kinematics, pid control of position, touch control using smartgpu_v1 board for viewing data or debug messages while moving a 4 DOF robotic arm.
Dependencies: AX12 InversKinem PIDPositionController SMARTGPU SerialHalfDuplex mbed
http://mbed.org/users/aimen/notebook/4dofroboticarmax12_lpc1768-with-smartgpu/
Diff: main.cpp
- Revision:
- 2:de8b38a39938
- Parent:
- 0:91d276232027
- Child:
- 3:41b605f9cdd5
--- a/main.cpp Tue Apr 01 06:56:05 2014 +0000 +++ b/main.cpp Tue Apr 01 07:29:17 2014 +0000 @@ -9,6 +9,10 @@ DigitalOut myled3(LED3); DigitalOut myled4(LED4); AX12 myax12_1(p9,p10,1); //(TX,RX, ID of servo); +AX12 myax12_2(p9,p10,2); //(TX,RX, ID of servo); +AX12 myax12_3(p9,p10,3); //(TX,RX, ID of servo); +AX12 myax12_4(p9,p10,4); //(TX,RX, ID of servo); +AX12 myax12_5(p9,p10,5); //(TX,RX, ID of servo); int main() { @@ -19,17 +23,26 @@ while(1) { myled1 = 1; - lcd.string(10,10,300,220,YELLOW,FONT3,TRANS,"Before set goal 0"); //write a string on the screen - myax12_1.SetGoal(0); // go to 0 degrees - lcd.string(10,70,300,220,YELLOW,FONT3,TRANS,"after goal 0"); //write a string on the screen + lcd.string(10,10,300,220,YELLOW,FONT3,TRANS,"Before set goal 150"); //write a string on the screen + myax12_1.SetGoal(150); // go to 150 degrees + myax12_2.SetGoal(150); // go to 150 degrees + myax12_3.SetGoal(150); // go to 150 degrees + myax12_4.SetGoal(150); // go to 150 degrees + myax12_5.SetGoal(290); // go to 150 degrees + lcd.string(10,70,300,220,YELLOW,FONT3,TRANS,"after goal 150"); //write a string on the screen wait_ms(1000); + lcd.erase(); myled1 = 0; myled4 = 1; - lcd.string(10,10,300,220,YELLOW,FONT3,TRANS,"Before set goal 300"); //write a string on the screen - myax12_1.SetGoal(300); // go to 300 degrees - lcd.string(10,70,300,220,YELLOW,FONT3,TRANS,"after goal 300"); //write a string on the screen + lcd.string(10,10,300,220,YELLOW,FONT3,TRANS,"Before set goal fold up"); //write a string on the screen + //myax12_1.SetGoal(300); // go to 150 degrees + myax12_2.SetGoal(225); // go to 150 degrees + myax12_3.SetGoal(0); // go to 150 degrees + myax12_4.SetGoal(90); // go to 150 degrees + myax12_5.SetGoal(250); // go to 150 degrees + lcd.string(10,70,300,220,YELLOW,FONT3,TRANS,"after goal fold up"); //write a string on the screen wait_ms(1000); + lcd.erase(); myled4 = 0; }//end of main while loop } -