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
- Committer:
- Sainratp
- Date:
- 2017-10-23
- Revision:
- 5:19a7a0f972cb
- Parent:
- 4:e0ca69606fdf
File content as of revision 5:19a7a0f972cb:
#include "mbed.h"
#include "DO/DO.h"
#include "MO/MO.h"
#include "rtos.h"
#include "config.h"
DigitalOut led1(LED1);
DigitalOut out(PIN_OUT);
InterruptIn in(PIN_IN);
Serial pc(USBTX,USBRX);
Ticker ticker;
char test[5]={0x01,0x01,0x01,0x01,0x01};
Thread sendCharThread;
Thread sendDataThread;
Thread receiveBitThread;
Thread receiveCharThread;
Thread receiveDataThread;
void interruptRise()
{
receiveBitThread.signal_set(0x01);
}
void interruptFall()
{
receiveBitThread.signal_set(0x01);
}
void wake()
{
sendCharThread.signal_set(0x01);
led1=!led1;
}
int main()
{
led1=1;
sendCharThread.start(&sendChar);
sendCharThread.set_priority(osPriorityHigh);
receiveBitThread.start(&receiveBit);
receiveBitThread.set_priority(osPriorityHigh);
receiveCharThread.start(&receiveChar);
receiveDataThread.start(&receiveData);
sendDataThread.start(&sendData);
ticker.attach(&wake,T/2.0);
wait(1);
in.rise(&interruptRise);
in.fall(&interruptFall);
wait(1);
int i =0;
while(i<5) {
createTrame(test,5);
i++;
}
}