Marlon Fulla / Mbed 2 deprecated 2015NOV21_XBEETESTROUT

Dependencies:   mbed

Fork of 2014ENE20_XBEETESTROUT by Marlon Fulla

Revision:
0:681c5f49ef09
Child:
1:273b1f91d518
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Jan 21 01:06:53 2014 +0000
@@ -0,0 +1,53 @@
+#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="";  
+
+    }
+
+}