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:
- marlonfulla
- Date:
- 2014-01-21
- Revision:
- 0:681c5f49ef09
- Child:
- 1:273b1f91d518
File content as of revision 0:681c5f49ef09:
#include "mbed.h"
//#include "SDFileSystem.h"
//#include <iostream>
#include <string>
//using namespace std;
Serial xbee(USBTX,USBRX);
string caracter,tira;
int npack,delay,ncharacters;
char read[64];
int main()
{
xbee.baud(115200);
caracter="A";
tira="";
while(1) {
// cin>>caracteres;
/* xbee.scanf("%d",caracteres);
*/
xbee.scanf("%s",read);
ncharacters=atoi(read);
for(int s=1; s<=ncharacters ;s++) {
tira=tira.append(caracter);
}
xbee.scanf("%s",read);
npack=atoi(read);
xbee.scanf("%s",read);
delay=atoi(read);
// cin>>recibido;
// cin>>delay;
for(int i=1; i<=npack ;i++) {
//cout<<tira<<'\n';
xbee.printf("%s",tira);
wait_us(delay);
}
xbee.printf("D");
tira="";
}
}