generate functionTue, 17 Jan 2023

HONDA 433MHZ receive signals

const int rxPin = 2; //RX pin of RF receiver module const int txPin = 3; //TX pin of RF transmitter module const int ledPin = 13; //pin on which LED is connected int val; //variable to store received data void setup() { //initializing serial communication Serial.begin(9600); pinMode(ledPin, OUTPUT); //pinMode(rxPin, INPUT); //pinMode(txPin, OUTPUT); } void loop() { //read data from receiver and store in val val = digitalRead(rxPin); Serial.println(val); //if data=0, turn off led if (val == 0){ digitalWrite(ledPin, LOW); } //if data=1, turn on led if (val == 1){ digitalWrite(ledPin, HIGH); } delay(1); }

Questions about programming?Chat with your personal AI assistant