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:
- Sumobot
- Date:
- 2017-03-03
- Revision:
- 0:a68449ee4734
File content as of revision 0:a68449ee4734:
#include "mbed.h"
Serial xbee(p9,p10);
DigitalOut myled(LED1);
DigitalOut myled2(LED2);
Serial pc(USBTX, USBRX);
DigitalIn a(p12);
DigitalIn b(p13);
int dis, sub;
//DigitalIn c(p23);
//DigitalIn d(p24);
int main() {
pc.baud(9600);
while(1) {
if(a==1)
{
dis = 0;
sub = 0;
xbee.printf("E.A,%D:%D\n", sub, dis);
myled = !myled;
wait(1);
}
if(b==1)
{
sub = 1;
dis = 1;
xbee.printf("E.A,%D:%D\n", sub, dis);
myled2 = !myled2;
wait(1);
}
}
}