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:
- lscordovar
- Date:
- 2020-02-14
- Revision:
- 7:24db87395b87
- Parent:
- 6:2a3a62ee17fa
- Child:
- 8:90d88a3a2e9a
File content as of revision 7:24db87395b87:
#include "mbed.h"
RawSerial pc(PA_2,PA_3);
RawSerial dev(PB_6,PB_7); // tx, rx// tx, rx
DigitalOut led1(PD_12); // (PTB18)
DigitalOut led2(PD_13); // (PTB19)
DigitalOut led4(PD_14); // (PTD1)
/*
Connecting...
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 18:fe:34:d7:a3:da
*/
void dev_recv()
{
led1 = !led1;
while(dev.readable()) {
pc.putc(dev.getc());
}
}
void pc_recv()
{
led4 = !led4;
while(pc.readable()) {
dev.putc(pc.getc());
}
}
int main()
{
pc.baud(115200);
dev.baud(115200);
pc.attach(&pc_recv, Serial::RxIrq);
dev.attach(&dev_recv, Serial::RxIrq);
while(1) {
sleep();
}
}