Jdy40 Arduino Example Best Official
Before writing code, it is essential to understand the pin layout and specifications of the JDY-40 module. Pin Configuration
#include <SoftwareSerial.h>
On the receiver’s Serial Monitor, you should see: Received: Button Pressed! jdy40 arduino example best
If you run into issues, here are the most common problems and solutions:
Here are the essential pins you will use: Before writing code, it is essential to understand
Open your Arduino Serial Monitor, set the line ending to , and type these commands: Send AT →right arrow Module should respond with +OK (Confirms connection). Send AT+CLSS →right arrow
: 15mA in transmission, sub-microamps in sleep mode Wiring the JDY-40 to Arduino Send AT+CLSS →right arrow : 15mA in transmission,
#include // Connect JDY-40 TX to Arduino Pin 2, RX to Arduino Pin 3 SoftwareSerial jdy40(2, 3); void setup() // Start hardware serial for PC communication Serial.begin(9600); // Start software serial for JDY-40 jdy40.begin(9600); Serial.println("JDY-40 Connected. Type something..."); void loop() // If data comes from JDY-40, send it to PC if (jdy40.available()) Serial.write(jdy40.read()); // If data comes from PC, send it to JDY-40 if (Serial.available()) jdy40.write(Serial.read()); Use code with caution. Steps to Run Upload the code to both Arduino boards.
// Feature Flag: Set to true once we configure the module bool isConfigured = false;
: Serial Data Output (Connects to Arduino RX / Software RX).
Many makers wonder how the JDY-40 compares to the popular nRF24L01. Here's a quick comparison to help you decide which is right for your project: