Jdy40 Arduino Example Best
const int buttonPin = 7; int buttonState = 0; int lastButtonState = HIGH;
: Send AT+DVID1122 -> Must match on both modules for transparent 1-to-1 communication.
To prevent interference with the hardware serial port (used for uploading code to the Arduino), we use SoftwareSerial to configure and test the module. JDY-40 Pin Arduino Uno Pin Do not use 5V Common ground Pin 2 (Rx) Directly connected Pin 3 (Tx) Use a 1kΩ / 2kΩ resistor voltage divider Used to toggle AT mode Module always enabled Part 1: Configuring the JDY-40 with AT Commands jdy40 arduino example best
Before you write a single line of code, you need to connect the hardware correctly. The JDY-40 has 14 pins, but only 5 are essential for basic use.
#include <SoftwareSerial.h>
Arduino (Allows the sketch to programmatically switch between AT mode and data mode). JDY-40 CS →right arrow
void setup() Serial.begin(9600); // Debug console jdy40.begin(9600); // JDY-40 baud rate pinMode(buttonPin, INPUT_PULLUP); Serial.println("JDY-40 Transmitter Ready"); const int buttonPin = 7; int buttonState =
/* * JDY-40 Remote Node (e.g., ID=1) * Receives commands from the hub. */
Unlike the NRF24L01, which requires complex libraries and heavy SPI wiring, the JDY-40 uses basic Serial communication (RX/TX). The JDY-40 has 14 pins, but only 5
Power supply (Supports 2.2V to 3.6V. Note: Use a 3.3V pin on Arduino, or an external regulator ). GND: Ground connection. TXD: Serial transmit pin (connects to Arduino RX).