Then we need to create the RF24 object, and include it into the RF24Network object. write(header, &angleValue, sizeof(angleValue)) // Send the dataįirst we need to include both libraries RF24 and RF24Network, as well as the SPI library. Unsigned long potValue = analogRead(A0) // Read the potentiometer value unsigned long angleValue = map(potValue, 0, 1023, 0, 180) // Convert the value to 0-180 RF24NetworkHeader header (node01) // (Address where the data is going) bool ok = network. begin( 90, this_node) //(channel, node address) */ # include # include # include RF24 radio ( 10, 9) // nRF24L01 (CE,CSN) RF24Network network (radio) // Include the radio in the network const uint16_t this_node = 00 // Address of this node in Octal format ( 04,031, etc) const uint16_t node01 = 01 = Example 01 - Servo Control / Node 00 - Potentiometer = Here’s the code at the potentiometer side: /*Īrduino Wireless Network - Multiple NRF24L01 Tutorial Let’s take a look at the source codes now. So using the potentiometer at the first Arduino we will control the servo motor at the second Arduino. As an Amazon Associate I earn from qualifying purchases. Amazon / Banggood / AliExpressĭisclosure: These are affiliate links.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |