| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #include "My_Eeprom.h"
- #include <EEPROM.h>
- #include "Testeur.h"
- void setup() {
- Serial.begin(115200);
-
- pinMode(pinBRAS1, INPUT);
- pinMode(pinBRAS2, INPUT);
- pinMode(pinOSMOL, INPUT);
- pinMode(pinCHAUF, INPUT);
- pinMode(pinECUME, INPUT);
- pinMode(pinREMON, INPUT);
- attachInterrupt(digitalPinToInterrupt(pinBRAS1), fc_BRAS1, CHANGE); //CHANGE, RISING,FALLING
- attachInterrupt(digitalPinToInterrupt(pinBRAS2), fc_BRAS2, CHANGE); //CHANGE, RISING,FALLING
- attachInterrupt(digitalPinToInterrupt(pinOSMOL), fc_OSMO, CHANGE); //CHANGE, RISING,FALLING
- attachInterrupt(digitalPinToInterrupt(pinCHAUF), fc_CHAUFF, CHANGE); //CHANGE, RISING,FALLING
- attachInterrupt(digitalPinToInterrupt(pinECUME), fc_ECUM, CHANGE); //CHANGE, RISING,FALLING
- attachInterrupt(digitalPinToInterrupt(pinREMON), fc_REMO, CHANGE); //CHANGE, RISING,FALLING
- }
- void loop() {
- //analogRead(vent1);
- //analogRead(vent2);
- delay(5000);
- }
- void fc_BRAS1() {
- if(digitalRead(pinBRAS1)){
- Enregistre(BR1ON);
- }
- else{
- Enregistre(BR1OF);
- }
- }
- void fc_BRAS2() {
- if(digitalRead(pinBRAS2)){
- Enregistre(BR2ON);
- }
- else{
- Enregistre(BR2OF);
- }
- }
- void fc_OSMO() {
- if(digitalRead(pinOSMOL)){
- Enregistre(OSMON);
- }
- else{
- Enregistre(OSMOF);
- }
- }
- void fc_CHAUFF() {
- if(digitalRead(pinCHAUF)){
- Enregistre(CHAON);
- }
- else{
- Enregistre(CHAOF);
- }
- }
- void fc_ECUM() {
- if(digitalRead(pinECUME)){
- Enregistre(ECUON);
- }
- else{
- Enregistre(ECUOF);
- }
- }
- void fc_REMO() {
- if(digitalRead(pinREMON)){
- Enregistre(REMON);
- }
- else{
- Enregistre(REMOF);
- }
- }
|