Page 241 - 최강 아두이노 스마트 자동차 로봇 키트
P. 241

return true;
                             }
                         }
                         return false;
                     }
                     unsigned char getMotorLValue()
                     {
                         unsigned char szProto[14];
                         memcpy(szProto, protocolPool, 14);
                         //memcpy(lproto, protocolPool, 14);
                         if (szProto[0] == 0x0C &&
                             szProto[1] == 0x00 &&
                             szProto[2] == 0x80 &&
                             szProto[3] == 0x04 &&
                             szProto[4] == 0x02)
                         {
                             unsigned char l = szProto[5];// -0x32;
                             return l;
                         }
                         return 0x00;
                     }

                     unsigned char getMotorRValue()
                     {
                         //String  szProto = &protocolPool[14];
                         unsigned char szProto[14];
                         memcpy(szProto, &protocolPool[14], 14);
                         if (szProto[0] == 0x0C &&
                             szProto[1] == 0x00 &&
                             szProto[2] == 0x80 &&
                             szProto[3] == 0x04 &&
                             szProto[4] == 0x01)
                         {
                             unsigned char l = szProto[5];// -0x32;
                             return l;
                         }
                         return 0x00;
                     }
                 };

                 _CommProtocol SerialCommData;


                 void init_SerialCommModule()
                 {





                                                   240
   236   237   238   239   240   241   242   243   244   245   246