Merci dfgh,
J'ai fait les tests et Je comprends très bien sauf l'instruction 'cli()' et sei();
Sans vouloir abuser, pourriez-vous me dire ce que vous pensez de l'utilisation du Watchdog Timer dans ce code ?
Quelle est son incidence dans ce Croquis?
https://forum.arduino.cc/t/volets-roulants-somfy-rts-rfm69hcw/910646/29
#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() {
//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);
pinMode(8, INPUT_PULLUP);
wdt_enable(WDTO_250MS);
}
void loop() {
if (digitalRead(7) == LOW)
{
myRTS.sendSomfy(3, DOWN); // remote 0, downloop
delay(30000);
//myRTS.setHighPower(false);
wdt_reset();
}
if (digitalRead(8) == LOW)
{
myRTS.sendSomfy(3, UP); // remote 0, up
delay(30000);
// myRTS.setHighPower(false);
wdt_reset();
}
}
Merci beaucoup.