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.
main.cpp
00001 #include "mbed.h" 00002 00003 DigitalOut led1(LED1); 00004 DigitalOut led2(LED2); 00005 DigitalOut led3(LED3); 00006 DigitalOut led4(LED4); 00007 00008 Serial pc(USBTX, USBRX); // tx, rx 00009 Serial device(p28, p27); // tx, rx 00010 00011 int main() { 00012 int i; 00013 device.baud(19200); 00014 char auto_command[] 00015 = {0xaa, 0xbb, 0x12, 0x04, 0x02, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x11}; 00016 char success_command[] 00017 ={0xaa, 0xbb, 0x02, 0x04, 0x06}; 00018 00019 00020 for(i=0;i<21;i++) 00021 device.putc(auto_command[i]); 00022 00023 for(i=0;i<5;i++){ 00024 if(success_command[i] != device.getc()){ 00025 pc.printf("Program failure...\n"); 00026 return -1; 00027 } 00028 } 00029 pc.printf("Program success!\n"); 00030 led1=1; 00031 led2=1; 00032 led3=1; 00033 led4=1; 00034 return 0; 00035 }
Generated on Fri Jul 22 2022 04:54:35 by
1.7.2