final lab 6, écran lcd

Dependencies:   mbed-rtos mbed mlcd_32pt

Files at this revision

API Documentation at this revision

Comitter:
annicksenecal
Date:
Mon Dec 02 21:14:25 2013 +0000
Child:
1:bbb636a6ce10
Commit message:
d?but, le capteur est lu et la DEL flashe...

Changed in this revision

mbed.lib Show annotated file Show diff for this revision Revisions of this file
mlcd_32pt.lib Show annotated file Show diff for this revision Revisions of this file
testLab6.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.lib	Mon Dec 02 21:14:25 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/#673126e12c73
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mlcd_32pt.lib	Mon Dec 02 21:14:25 2013 +0000
@@ -0,0 +1,1 @@
+mlcd_32pt#d5e6226759e6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testLab6.cpp	Mon Dec 02 21:14:25 2013 +0000
@@ -0,0 +1,36 @@
+// Print messages when the AnalogIn is greater than 50%
+
+#include "mbed.h"       
+#include "mlcd_32pt.h"      //Librairie pour l'écran LCD
+#include "Serial.h"         //Librairie pour la communication série
+
+
+AnalogIn ir(p19);           //Initialisation de la pin qui reçoit la valeur du capteur infra-rouge
+DigitalOut myled(LED4);     //Sert surtout au dépannage
+DigitalOut myled2(LED2);    //Sert surtout au dépannage
+
+
+
+int main() {
+    
+    //init_com(BAUD115200);
+    //init_lcd();
+    //initMenu();
+    //setbgColor(
+
+    while(1) {
+        if(ir < .5) {
+            printf("c'est noir! (%f)", ir.read());
+                myled = 1;
+                wait(1.5);
+                myled = 0;
+                wait(1.5);
+        }
+        else {
+            printf("c'est blanc! (%f)", ir.read());
+                myled2 = 1;
+                wait(1.5);
+                myled2 = 0;
+                wait(1.5);}
+    }
+}