Instantly share code, notes, and snippets.
ls /dev
sudo cu -s 115200 -l /dev/tty.usbserial-1420 > ~/usbserial-1420.txt
There was an error while loading. Please reload this page.
/* 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()) { Serial.print("Received "); Serial.print(mySwitch.getReceivedValue()); Serial.print(" / "); Serial.print(mySwitch.getReceivedBitlength()); Serial.print("bit "); Serial.print("Protocol: "); Serial.print(mySwitch.getReceivedProtocol()); Serial.print(" Delay: "); Serial.print(mySwitch.getReceivedDelay()); Serial.println(); mySwitch.resetAvailable(); } }
$ sudo cu -s 9600 -l /dev/tty.usbserial-1420 Password: Connected. Received 499570 / 24bit Protocol: 1 Delay: 320 Received 499570 / 24bit Protocol: 1 Delay: 320 Received 499570 / 24bit Protocol: 1 Delay: 325 Received 499570 / 24bit Protocol: 1 Delay: 320 Received 499570 / 24bit Protocol: 1 Delay: 320 Received 499570 / 24bit Protocol: 1 Delay: 320 Received 499570 / 24bit Protocol: 1 Delay: 321 Received 499570 / 24bit Protocol: 1 Delay: 325 Received 499570 / 24bit Protocol: 1 Delay: 321
Sorry, something went wrong.
Handle wireless button press
Hardware
Manual
Code
Output