![](/media/cache/group/11700697_10200701668420946_8214886085951071495_o.jpg.50x50_q85.jpg)
โปรแกรมของบอร์ด Motion
Dependencies: BEAR_Reciever Motor eeprom iSerial mbed
Fork of DogPID by
Diff: main.cpp
- Revision:
- 32:1f81f3e83889
- Parent:
- 31:d6fa5e8e26b3
- Child:
- 33:65cfa4b72195
- Child:
- 34:0cf04acfe422
diff -r d6fa5e8e26b3 -r 1f81f3e83889 main.cpp --- a/main.cpp Mon Feb 01 19:02:56 2016 +0000 +++ b/main.cpp Tue Feb 02 01:31:15 2016 +0000 @@ -130,7 +130,7 @@ void Move_Upper() { Read_Encoder(EncoderA); - Upper_Position = (int)Get_EnValue(data); + Upper_Position = Get_EnValue(data); Up_PID.setProcessValue(Upper_Position); @@ -146,7 +146,7 @@ void Move_Lower() { Read_Encoder(EncoderB); - Lower_Position = (int)Get_EnValue(data); + Lower_Position = Get_EnValue(data); Low_PID.setProcessValue(Lower_Position); @@ -175,8 +175,8 @@ break; } case MOTOR_UPPER_ANG: { - uint8_t IntUpAngle[2],FloatUpAngle[2]; - uint8_t IntLowAngle[2],FloatLowAngle[2]; + uint8_t IntUpAngle[2]; + uint8_t IntLowAngle[2]; IntUpAngle[0]=command[1]; IntUpAngle[1]=command[2]; @@ -330,7 +330,7 @@ int i; for(i=0; i<8; i++) { Angle_Range_Up[i]=command[1+i]; - //printf("%d Angle = 0x%02x\r\n",i,Angle_Range_Up[i]); + //printf("%d Angle = 0x%02x\r\n",i,Angle_Range_Up[i]); } break; } @@ -729,7 +729,7 @@ wait(0.5); } */ - + //Recieve.attach(&Rc,0.025); //Start_Up(); @@ -741,7 +741,6 @@ while(1) { myled =0; //wait_ms(10); - ///////////////////////////////////////////////////// start //Set Set_point Up_PID.setSetPoint(Upper_SetPoint);