• Witaj na Forum Arduino Polska! Zapraszamy do rejestracji!
  • Znajdziesz tutaj wiele informacji na temat hardware / software.
Witaj! Logowanie Rejestracja


Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Odbiornik 433Mhz RF i odczytywanie kodu pilota.
#1
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:

[Obrazek: 1759717600_1520709274_thumb.jpg][Obrazek: 6967425600_1520709280_thumb.jpg][Obrazek: 4117188500_1520709283_thumb.jpg]
[Obrazek: 5396881300_1520709318_thumb.jpg][Obrazek: 6966766500_1520709328_thumb.jpg][Obrazek: 3302452500_1520709329_thumb.jpg]

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?
 
Odpowiedź
  


Skocz do:


Przeglądający: 1 gości