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 #include <string.h> 00003 #include "rtos.h" 00004 #include "SpeedCalculate.h" 00005 #include "Data.h" 00006 #include "UserInput.h" 00007 00008 LocalFileSystem local("local"); 00009 00010 Serial pc(USBTX, USBRX); //conection to PC 00011 Serial mbed2(p9,p10); //conection to mbed2 00012 DigitalOut led_indactor(LED1); 00013 00014 Data data; 00015 00016 void speed_thread(void const *args) 00017 { 00018 SpeedCalculate speed; 00019 00020 speed.calculate(1,4); 00021 } 00022 00023 void handShake() 00024 { 00025 unsigned char input; 00026 pc.printf("a\n"); 00027 00028 while(true) 00029 { 00030 input = pc.getc(); 00031 if (input == 'a') 00032 { 00033 led_indactor = 1; 00034 break; 00035 } 00036 } 00037 } 00038 00039 int main() 00040 { 00041 int number = 2; 00042 //handShake(); 00043 // data.initialise(); 00044 // while(!(pc.readable() && pc.getc() == 'b')){ 00045 // //run 00046 // } 00047 // Thread sThread(speed_thread); 00048 // while(!(pc.readable() && pc.getc() == 's')){ 00049 // //run 00050 // } 00051 // sThread.terminate(); 00052 mbed2.printf("%d", number); 00053 while(!mbed2.readable()){} 00054 mbed2.scanf("%d", &number); 00055 pc.printf("%d", number); 00056 }
Generated on Sat Jul 23 2022 19:08:16 by
1.7.2