找回密码
 注册

QQ登录

只需一步,快速开始

Jdy40 Arduino Example Best May 2026

Out of the box, the JDY-40 works. But to eliminate interference and maximize range, you must configure it via AT commands.

Serial.println("JDY-40 Master/Slave Ready");

// Optional: Set the module to transparent transmission (default mode) pinMode(4, OUTPUT); // SET pin digitalWrite(4, HIGH); // HIGH = Data mode, LOW = AT mode jdy40 arduino example best

// Parse your data here if (receivedData.startsWith("TEMP:")) // Extract and act on data receivedData = ""; else receivedData += c;

bool sendCommand(String cmd) jdy40.println(cmd); unsigned long timeout = millis() + 500; while (millis() < timeout) if (jdy40.find("ACK")) return true; return false; // Retry or indicate failure Out of the box, the JDY-40 works

String receivedData = "";

void setup() Serial.begin(9600); // For debugging via USB jdy40.begin(9600); // JDY-40 default baud rate Out of the box

// Send data, then enter deep sleep jdy40.println("SENSOR:OK"); delay(10); // Put JDY-40 to sleep via AT command pinMode(4, OUTPUT); digitalWrite(4, LOW); jdy40.println("AT+SLEEP=2"); // Deep sleep delay(50); // Now sleep the Arduino (using LowPower library) Never send a command without an acknowledgment.

Archiver|手机版|小黑屋|Video Game Do It Yourself ( 闽ICP备14000865号-1|jdy40 arduino example best闽公网安备35018102240098号 )

GMT+8, 2026-3-9 07:57 , Processed in 0.122916 second(s), 13 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表