ESP-12F (ESP8266) interrupt for RC-Switch library 433Mhz signal

Soleyman
Posts: 1
Joined: Fri Sep 02, 2022 8:44 am

ESP-12F (ESP8266) interrupt for RC-Switch library 433Mhz signal

Postby Soleyman » Wed Oct 16, 2024 8:30 am

Hello friends

I want to modify this Arduino code for esp8266 – ESP-12F.

(It's RC-Switch Sample)

My question is about this line equal in ESP

mySwitch.enableReceive(0); // Receiver on interrupt 0 => that is pin #2

I try code by "D2" and connect module to pin D4.
it's work but built blue LED always show fast pulse.
I'm not sure but I think it's not stable because it's need to define interrupt and some code.
I want stable code for use interrupt to read RF433/315Mhz module in loop by ESP-12F as same as Arduino code.

Thanks

Code: Select all

#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
Serial.begin(9600);
mySwitch.enableReceive(0); // Receiver on interrupt 0 => that is pin
}
void loop() {
if (mySwitch.available()) {
output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
mySwitch.resetAvailable();
Serial.println();
}
}

Who is online

Users browsing this forum: No registered users and 13 guests