Programme complet

Dependencies:   DHT11 HMC5883L

Files at this revision

API Documentation at this revision

Comitter:
jijou
Date:
Wed Jan 18 14:21:05 2017 +0000
Parent:
0:35dbc783d23a
Commit message:
+rfid

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 35dbc783d23a -r c82fe7774fde main.cpp
--- a/main.cpp	Fri Jan 06 13:31:35 2017 +0000
+++ b/main.cpp	Wed Jan 18 14:21:05 2017 +0000
@@ -7,6 +7,7 @@
 //-------Pin Connection----///
 DHT11 sensor(D4);//D4=jeremy
 HMC5883L bouss(PB_9, PB_8); // HMC5883L(PinName sda, PinName scl) PB_8 + PB_9
+Serial rfid(PA_9, PA_10); // pa9=d8 pa10=d2
 AnalogIn inputx(PC_0); // input PC_0 for X axis
 AnalogIn inputy(PC_1); // input PC_1 for Y axis
 AnalogIn inputz(PB_1); // input PB_1 for Z axis
@@ -54,6 +55,24 @@
 //----------------Accelerometre/end------------------//
     
     
-    wait(60);
+//-----------------------RFID----------------------------//
+ #define PRINT_CALCULATED
+ #define PRINT_SPEED 500 // 500 ms between prints
+     serial.printf("Verification\r\n");
+
+     int i;
+     int tag[15];
+     char buff[55];
+
+
+         for(i=0;i<5;i++)
+             tag[i]=rfid.getc();
+
+         sprintf(buff,"%d%d%d%d%d",tag[0],tag[1],tag[2],tag[3],tag[4]);
+         serial.printf("%s \r\n",buff);
+
+//-----------------------RFID----------------------------//
+
+    wait(5);
 }
 }