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 "DO/DO.h" 00003 #include "MO/MO.h" 00004 #include "rtos.h" 00005 #include "config.h" 00006 00007 00008 DigitalOut led1(LED1); 00009 00010 DigitalOut out(PIN_OUT); 00011 InterruptIn in(PIN_IN); 00012 00013 Serial pc(USBTX,USBRX); 00014 00015 Ticker ticker; 00016 00017 char test[5]={0x01,0x01,0x01,0x01,0x01}; 00018 00019 00020 Thread sendCharThread; 00021 Thread sendDataThread; 00022 00023 Thread receiveBitThread; 00024 Thread receiveCharThread; 00025 Thread receiveDataThread; 00026 00027 00028 00029 00030 void interruptRise() 00031 { 00032 receiveBitThread.signal_set(0x01); 00033 } 00034 00035 void interruptFall() 00036 { 00037 receiveBitThread.signal_set(0x01); 00038 } 00039 00040 void wake() 00041 { 00042 sendCharThread.signal_set(0x01); 00043 led1=!led1; 00044 } 00045 00046 00047 00048 int main() 00049 { 00050 00051 00052 led1=1; 00053 00054 sendCharThread.start(&sendChar); 00055 sendCharThread.set_priority(osPriorityHigh); 00056 00057 receiveBitThread.start(&receiveBit); 00058 receiveBitThread.set_priority(osPriorityHigh); 00059 receiveCharThread.start(&receiveChar); 00060 receiveDataThread.start(&receiveData); 00061 00062 sendDataThread.start(&sendData); 00063 ticker.attach(&wake,T/2.0); 00064 wait(1); 00065 in.rise(&interruptRise); 00066 in.fall(&interruptFall); 00067 wait(1); 00068 int i =0; 00069 while(i<5) { 00070 createTrame(test,5); 00071 i++; 00072 } 00073 00074 }
Generated on Wed Jul 13 2022 06:55:34 by
1.7.2