10-03-2018, 21:43
Witam jakiś czas temu zakupiłem transmiter i odbiornik 433Mhz i postępowałem według poradnika:
O to jak wygląda to u mnie:
Sketch który załadowałem do arduino:
Po wciśnięciu przycisku na pilocie brak reakcji, serial port pusty, czy może mi ktoś pomóc w rozwiązaniu problemu?
O to jak wygląda to u mnie:
Sketch który załadowałem do arduino:
Kod:
/*
Simple example for receiving
https://github.com/sui77/rc-switch/
*/
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
Serial.begin(9600);
mySwitch.enableReceive(0); // Receiver on interrupt 0 => that is pin #2
}
void loop() {
if (mySwitch.available()) {
int value = mySwitch.getReceivedValue();
if (value == 0) {
Serial.print("Unknown encoding");
} else {
Serial.print("Received ");
Serial.print( mySwitch.getReceivedValue() );
Serial.print(" / ");
Serial.print( mySwitch.getReceivedBitlength() );
Serial.print("bit ");
Serial.print("Protocol: ");
Serial.println( mySwitch.getReceivedProtocol() );
}
mySwitch.resetAvailable();
}
}
Po wciśnięciu przycisku na pilocie brak reakcji, serial port pusty, czy może mi ktoś pomóc w rozwiązaniu problemu?