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:
- 2015-11-21
- Revision:
- 1:273b1f91d518
- Parent:
- 0:681c5f49ef09
- Child:
- 2:ff11ef31aee5
File content as of revision 1:273b1f91d518:
#include "mbed.h"
//#include "SDFileSystem.h"
//#include <iostream>
#include <string>
//using namespace std;
Serial xbee(USBTX,USBRX);
Timer reloj;
string caracter,tira;
int npack,delay,ncharacters;
char read[64];
int tiempo;
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;
reloj.start();
for(int i=1; i<=npack ;i++) {
//cout<<tira<<'\n';
xbee.printf("%s",tira);
wait_us(delay);
}
reloj.stop();
tiempo=reloj.read_us();
xbee.printf("%d",tiempo);
tira="";
reloj.reset();
}
}