Lit et convertit en irradiance la valeur analogique donnee par le capteur RG100.

Dependencies:   mbed RG100

Files at this revision

API Documentation at this revision

Comitter:
Station_Meteo_Laos
Date:
Sat Jun 29 12:37:18 2019 +0000
Commit message:
Lit et convertit en irradiance la valeur donne par le capteur RG100.

Changed in this revision

RG100.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 c7bcf321eaf3 RG100.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RG100.lib	Sat Jun 29 12:37:18 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/Station_Meteo_Laos/code/RG100/#b6d17e57602b
diff -r 000000000000 -r c7bcf321eaf3 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Jun 29 12:37:18 2019 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+#include "RG100.h"
+
+//Configure le port série à 9600 baud
+Serial serial(USBTX, USBRX, 9600);
+//Créer un objet RG100 de la classe RG100 avec son port  et le coeff d'étalonage
+RG100 rg100(A2, 1176.5);
+
+int main() {
+    int lecture = 0;
+    while(1) {
+        //Indente de 1 le nbre de lecture
+        lecture++;
+        //Lit le capteur et réalise la conversion
+        rg100.read();
+        //Affcihe le résultat
+        serial.printf("Lecture %d :\r\n", lecture);
+        serial.printf("Irradiance = %f W/m2\r\n\r\n", rg100.irradiance);
+        
+        wait(3.0);
+    }  
+}
diff -r 000000000000 -r c7bcf321eaf3 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Jun 29 12:37:18 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file