Motor control for robotic arm
Dependencies: MCP23017 WattBob_TextLCD mbed
Fork of Balanced Arm by
Diff: PC_Comms/PC_Comms.cpp
- Revision:
- 25:d345ef4cb2b5
- Parent:
- 24:462afd19d12e
- Child:
- 26:78282794606d
--- a/PC_Comms/PC_Comms.cpp Thu Mar 03 12:07:25 2016 +0000 +++ b/PC_Comms/PC_Comms.cpp Thu Mar 03 13:12:30 2016 +0000 @@ -12,13 +12,15 @@ #include "WattBob_TextLCD.h" #include "AX12.h" + MCP23017 *par_port; WattBob_TextLCD *lcd; Serial ax12_bus(p28, p27); Serial _PCbus(USBTX, USBRX); AX12 my_AX12(ax12_bus, _PCbus, p29, 1); + AX12 my_AX12_2(ax12_bus, _PCbus, p29, 2); + int angle2; - int angle2; //********************************************************************* // Object: @@ -87,9 +89,18 @@ angle[0] = Command[4]; angle[1] = Command[5]; angle[2] = Command[6]; - angle2 = atoi(angle); + angle2 = atoi(angle); my_AX12.SetGoal(angle2); break; + + case '1': + char angle1[3]; + angle1[0] = Command[4]; + angle1[1] = Command[5]; + angle1[2] = Command[6]; + angle2 = atoi(angle1); + my_AX12_2.SetGoal(angle2); + break; default: break; }