Jdy40 Arduino - Example Best Link

No for high data rates (max ~1-2KB/s). If you need to send sensor data, remote control, or simple text between two Arduinos, the JDY-40 is the most beginner-friendly 2.4GHz module available.

#include SoftwareSerial jdyWireless(2, 3); // RX, TX const int setPin = 4; const int sensorPin = A0; unsigned long previousMillis = 0; const long interval = 500; // Send data every 500ms void setup() pinMode(setPin, OUTPUT); digitalWrite(setPin, HIGH); // Set to transparent data mode Serial.begin(9600); jdyWireless.begin(9600); Serial.println("Master Transmitter Ready."); void loop() unsigned long currentMillis = millis(); if (currentMillis - previousMillis >= interval) previousMillis = currentMillis; // Read sensor and map to 0-255 byte scale int sensorValue = analogRead(sensorPin); byte mappedValue = map(sensorValue, 0, 1023, 0, 255); // Send packet format: jdyWireless.print('<'); jdyWireless.print(mappedValue); jdyWireless.print('>'); // Debug to local Serial Monitor Serial.print("Sent Value: "); Serial.println(mappedValue); Use code with caution. The Slave Code (Receiver)

This public link is valid for 7 days and shares a thread, including any personal information you added. This link or copies made by others cannot be deleted. If you share with third parties, their policies apply. Can’t copy the link right now. Try again later.

For more complex setups, you can implement a where a "hub" sends messages to specific "nodes" using JSON identifiers. In this setup, every node receives the message, but only the one matching the "destination" field in the data processes it. Key Performance Specs Frequency : 2.4GHz (2400-2483.5 MHz). Power Consumption : ~40mA (TX), ~24mA (RX), 5μA (Sleep). Max Speed : 19,200 bps for transparent transmission. jdy40 arduino example best

to avoid interfering with the Arduino's hardware serial (USB) port. It allows you to send data from one Serial Monitor to another wirelessly Longan Labs // Connect JDY-40 TX to D2, RX to D3 SoftwareSerial jdy40( setup() Serial.begin( // For debugging via USB jdy40.begin( // Default JDY-40 baud rate Serial.println( "JDY-40 Wireless Serial Ready" // If data is received from JDY-40, send to Serial Monitor (jdy40.available()) Serial.write(jdy40.read()); // If data is typed in Serial Monitor, send to JDY-40

Note: After configuring both modules with identical settings, remove the SET-to-GND connection, then power cycle the modules to return to communication mode. 5. Troubleshooting & Pro-Tips

This code receives the data and prints it to the Serial Monitor. No for high data rates (max ~1-2KB/s)

This sketch listens for incoming serial data from the JDY-40, parses the packet using start and end markers, and outputs the isolated integer to the serial monitor.

// Feature Flag: Set to true once we configure the module bool isConfigured = false;

// Variables for Non-blocking LED Blink unsigned long lastReceiveTime = 0; const long linkTimeout = 1000; // If no data for 1s, consider link idle The Slave Code (Receiver) This public link is

Before writing code, it is essential to understand the pin layout and specifications of the JDY-40 module. Pin Configuration

What the example typically includes (practical checklist)