Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed SHT21_ncleee ssd1306_library Adafruit_TCS34725 DS1820
Diff: main.cpp
- Revision:
- 11:5106c3ecc4d5
- Parent:
- 10:80babe03d9c4
- Child:
- 12:ad8d26614e1e
--- a/main.cpp Tue Oct 15 11:48:47 2019 +0000
+++ b/main.cpp Tue Oct 15 13:55:45 2019 +0000
@@ -8,7 +8,7 @@
#define I2C_SDA D4
#define I2C_SCL D5
-//Serial pc(SERIAL_TX, SERIAL_RX);
+Serial pc(SERIAL_TX, SERIAL_RX);
Serial nucleo(D1,D0);
I2C i2c(I2C_SDA, I2C_SCL);
@@ -29,6 +29,9 @@
// capteur lumière
AnalogIn ain(A1);
+//Interruption Bouton
+InterruptIn bouton(D12);
+
// Définition de fonctions
float temp_sol(void);
int fct_humidity_sol(void);
@@ -36,7 +39,7 @@
void sendDataSigfox(void);
void oledData(void);
void readData(void);
-
+void interruption_bouton(void);
float temperature_sol;
unsigned char humidity_sol;
@@ -53,6 +56,9 @@
oled.cls();
oled.set_contrast(200);
+ //Initialisation de l'interruption
+ bouton.fall(interruption_bouton);
+
// Initialisation WakeUp
//WakeUp::calibrate();
//WakeUp::set(10); // Durée entre deux envois à modifier
@@ -144,4 +150,9 @@
fct_RGB();
}
+void interruption_bouton(){
+ static int interruption_cpt = 0;
+ pc.printf("interruption %d\n\r", interruption_cpt++);
+}
+
