![]() ![]() The only property of the RC-Switch object we need to set is the pin that is connected to the receiver module. Here I’ve set the baud rate to 9600 bits per second and I’m using the on-board LED of the Leonardo to display when RF data is being received. For the receiver we also need to initialize a serial line so that we can display the received data in our serial monitor. ![]() To briefly explain the receiver code : Like the transmitter code we include the RC-Switch library and instantiate an RC-Switch object to give us access to all the RC-Switch methods. this should be called right after receiving data display the received data on the debug serial lineĭebug_Serial.println(mySwitch.getReceivedValue()) ĭebug_Serial.println(mySwitch.getReceivedBitlength()) turn on LED to show that data has been received enable the RC-Switch receiver pin and start checking for RF data enable the serial line used for debugging use the Leonardo's onboard LED to display data being received use Leonardo's Pin 3 to receive data on (Interrupt 0) Turn off led when transmission is completeĮxample code for an RF-Link 433MHz Receiver using the RC-Switch libraryįind the tutorial and Transmitter code here: Only the first 'length' bits of 'code' will be transmitted ![]() This is the data packet that will be transmitted Set the amount of times to re-transmit each data packet Set the desired pulse length in microseconds (Similar to baud rate) LED will be connected to physical pin 3 (Arduino Pin 4) ![]() Use ATtiny85 physical pin 5 to transmit (Arduino Pin 0) Use the RC-Switch Library to send data wirelessly between 2 micro-controllersįind the tutorial and Receiver code here: Processor - ATtiny85 programmed with Arduino IDE Example code for an RF-Link 433MHz Transmitter using the RC-Switch library ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |