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.
Dependencies: mbed
main.cpp
- Committer:
- LucaNeri
- Date:
- 2020-05-14
- Revision:
- 0:e39ab7c7639b
File content as of revision 0:e39ab7c7639b:
#include "mbed.h"
DigitalOut myled_1(LED1);
DigitalOut myled_2(LED2);
Serial pc(USBTX,USBRX, 230400);
Serial ZB(p28,p27, 230400);
int main() {
myled_1 = 1;
myled_2 = 1;
ZB.printf("I'm R1!\n");
while(1)
{
if (ZB.readable()){
char command = ZB.getc();
pc.printf("%c\n",command);
//ZB.printf("%c\n", command);
switch(command) {
case '1':
ZB.putc(1);
if (myled_1 == 0)
myled_1 = 1;
else if (myled_1 == 1)
myled_1 = 0;
break;
// case '2':
// if (myled_2 == 0)
// myled_2 = 1;
// else if (myled_2 == 1)
// myled_2 = 0;
// break;
}
}
}
}