Effectivement il semble y avoir un PB au niveau de la gestion des boutons pourtant j'avais essayé d'autres méthodes :
#include <avr/wdt.h>
#include <SomfyRTS.h>
SomfyRTS myRTS(3, TSR_RFM69); //Tx pin number, transmitter type
//pin number : pin connected to the transmitter DATA pin or to the DIO2 pin on RFM69
//transmitter type can be TSR_RFM69 or TSR_AM (for a generic AM 433.42MHZ transmitter)
void setup() {
Serial.begin(115200);
Serial.println("*****************************setup");Serial.flush();
//myRTS.configRTS(myEEPROM_address, myRTS_address); //uncomment and change values only if you don't want to use default configuration
myRTS.setHighPower(true); //have to call it after initialize for RFM69HW
pinMode(7, INPUT_PULLUP);//BP pour descendre le volet
pinMode(8, INPUT_PULLUP);//BP pour monter le volet
//wdt_enable(WDTO_250MS); //watchdog en service et initialisé à 250 milli
}
void loop() {
Serial.println("loop ");
if (digitalRead(7) == LOW) //si appui sur le BP "descente"
{Serial.println("descente ");
myRTS.sendSomfy(0, DOWN); // remote 0, downloop
delay(300);
//redemarre_arduino();
}
if (digitalRead(8) == LOW)//si appui sur le BP "montée"
{
Serial.println("montée ");
myRTS.sendSomfy(0, UP); // remote 0, up
delay(300);
//redemarre_arduino();
}
}
void redemarre_arduino(){
wdt_enable(WDTO_15MS);
while(1){
}
}
Je vais voir ce que je suis capable de faire ![]()
