Jdy40 Arduino Example Best Info
AT+RFID (Default is 1024 ). Both modules must match.
#include <SoftwareSerial.h>
: If you are looking to build a multi-node network (e.g., one hub and multiple remote nodes), Ben Emmett's JDY-40 Wireless Broadcast project provides complete Arduino and Python code examples using JSON formatting for message transmission.
: Use a 3.3V logic level. If you're using a 5V Arduino like the Uno, you'll need a voltage divider on the line from the Arduino's TX pin to the module's RX pin to prevent damage. jdy40 arduino example best
This sketch sets up a "Pass-through" bridge. It checks for incoming configuration commands from the PC and relays all other data transparently.
void loop() while (jdy40.available()) char c = jdy40.read(); if (c == '\n') // End of packet processPacket(buffer); buffer = ""; else buffer += c;
The AT+CLSS command changes the fundamental behavior of the GPIO pins from serial communication to various remote-control I/O modes. AT+RFID (Default is 1024 )
: Use the CS pin to wake the module only when it needs to transmit data, reducing power consumption to as low as 25 microamps during sleep.
To configure the module, pull the . All commands must end with \r\n (CR+LF).
Upload the same simple code to both Arduinos. It simply echoes any data it receives from the other module. : Use a 3
: Sets the device ID. Both modules must match to talk. Example: AT+DVID8888 .
Unlike traditional Bluetooth modules that require pairing protocols, the JDY-40 allows devices to communicate immediately as long as they share the same channel and device ID. Hardware Connection: JDY-40 to Arduino
: The JDY-40 logic is 3.3V. If using a 5V Arduino Uno or Nano, place a voltage divider or a 1k resistor between the Arduino TX pin and the JDY-40 RXD pin.
void setup() Serial.begin(9600); // Default baud rate