Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: LCD_DISCO_F429ZI mbed BSP_DISCO_F429ZI
main.cpp
00001 #include "servo.h" 00002 #include "command_decoder.h" 00003 #include "uart.h" 00004 00005 Servo MyServo(0.01); 00006 Decoder MyDecoder; 00007 00008 int main() 00009 { 00010 char cCommand[10]; 00011 while(1) 00012 { 00013 gets(cCommand, sizeof(cCommand)); 00014 MyDecoder.DecodeMsg(cCommand); 00015 if((MyDecoder.ucTokenNr > 0)&&(MyDecoder.asToken[0].eType == KEYWORD)) { 00016 switch(MyDecoder.asToken[0].uValue.eKeyword) { 00017 case ID: 00018 puts("Device ID: 0x01\n", sizeof("Device ID: 0x01\n")); 00019 break; 00020 case CLB: 00021 MyServo.Callib(); 00022 puts("OK\n", sizeof("OK\n")); 00023 break; 00024 case GOTO: 00025 if(MyDecoder.asToken[1].eType == NUMBER) { 00026 MyServo.GoTo(MyDecoder.asToken[1].uValue.uiNumber); 00027 puts("OK\n", sizeof("OK\n")); 00028 } 00029 break; 00030 case STEP: 00031 if(MyDecoder.asToken[1].eType == NUMBER) { 00032 MyServo.Step(MyDecoder.asToken[1].uValue.uiNumber); 00033 puts("OK\n", sizeof("OK\n")); 00034 } 00035 break; 00036 default: 00037 break; 00038 } 00039 } else { 00040 puts("unknowncommand\n", sizeof("unknowncommand\n")); 00041 } 00042 } 00043 }
Generated on Tue Aug 16 2022 02:56:50 by
 1.7.2
 1.7.2