Projet Long pour AGRAL

Dependencies:   mbed OneWire DHT22 TSL2561 SSD1306

Committer:
Pipou
Date:
Mon Sep 11 15:31:09 2017 +0000
Revision:
1:1b64ee29ae15
Parent:
0:75cfe7e78e4b
Child:
2:1e52e7fab454
Capteur humidit?

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Pipou 0:75cfe7e78e4b 1 #include "mbed.h"
Pipou 0:75cfe7e78e4b 2
Pipou 1:1b64ee29ae15 3 DigitalOut myled(PB_3);
Pipou 1:1b64ee29ae15 4 AnalogIn Hum(PA_0); //Entrée du capteur
Pipou 1:1b64ee29ae15 5 Serial pc(PA_2,PA_3); //Tx,Rx
Pipou 0:75cfe7e78e4b 6
Pipou 0:75cfe7e78e4b 7 int main() {
Pipou 0:75cfe7e78e4b 8 while(1) {
Pipou 0:75cfe7e78e4b 9 myled = 1; // LED is ON
Pipou 0:75cfe7e78e4b 10 wait(1.0); // 200 ms
Pipou 0:75cfe7e78e4b 11 myled = 0; // LED is OFF
Pipou 0:75cfe7e78e4b 12 wait(1.0); // 1 sec
Pipou 1:1b64ee29ae15 13
Pipou 1:1b64ee29ae15 14 pc.printf("%f",Hum.read()); //Lit l'entrée du capteur et l'affiche
Pipou 0:75cfe7e78e4b 15 }
Pipou 0:75cfe7e78e4b 16 }