Helmotz

Dependencies:   mbed

Revision:
0:8d7791a3b914
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Envoi.cpp	Thu May 18 10:25:12 2017 +0000
@@ -0,0 +1,27 @@
+#include <mbed.h>
+#include <Fonction.h>
+
+using namespace std;
+
+Serial Etrame(p13, p14, 9600); //(tx, rx, baud)
+int start3 = 0xFF;
+int start4 = 0xFF;
+int echecksum;
+int tabtest[9] = {0xFF, 0x74, 0x05, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17};
+DigitalOut led9(LED3);
+
+void envoi(){
+        led9 = 0;
+        Etrame.putc(start3);
+        Etrame.putc(start4);
+        echecksum += start3;
+        echecksum += start4;
+        for (int i = 0; i<9; i++) {
+            echecksum += tabtest[i];
+            Etrame.putc(tabtest[i]);
+        }
+        Etrame.putc(echecksum);
+        
+        led9 = 1;
+    
+}
\ No newline at end of file