Projets S4 IUT de Cachan / Mbed 2 deprecated Linky1

Dependencies:   C12832 mbed

Files at this revision

API Documentation at this revision

Comitter:
gr67
Date:
Fri Jun 24 07:45:41 2016 +0000
Commit message:
xx

Changed in this revision

C12832.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 21a112c29646 C12832.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/C12832.lib	Fri Jun 24 07:45:41 2016 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/chris/code/C12832/#7de323fa46fe
diff -r 000000000000 -r 21a112c29646 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jun 24 07:45:41 2016 +0000
@@ -0,0 +1,40 @@
+#include "mbed.h"
+#include "C12832.h"
+C12832 lcd(D11, D13, D12, D7, D10);
+AnalogIn tension(PB_1);
+AnalogIn courant(PB_2);
+Ticker integ;
+Ticker affich;
+//DigitalOut led(LED1);
+
+float V=1.3,I=0.4,P,E=0;
+
+void energie()
+{
+    V = 17*tension.read(); //
+
+    I = 170*courant.read();
+    P=V*I;
+    E = E+P*0.1;
+}
+void linky()
+{
+    lcd.locate(0,10);
+    lcd.printf("V=%4.1f V , I=%4.1f mA \nP=%4.0f mW E=%6.4f Wh", V,I,P,E/3600000);
+}
+int main()
+{
+
+    integ.attach(&energie,0.1);
+    affich.attach(&linky,1.0);
+    lcd.cls();
+    lcd.locate(0,0);
+    lcd.printf("LINKY LIKE");
+
+    while(1) {
+
+        
+
+        
+    }
+}
diff -r 000000000000 -r 21a112c29646 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jun 24 07:45:41 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7c328cabac7e
\ No newline at end of file