Jdy-40 | Arduino Example

void loop() { if (jdy.available()) { char c = jdy.read(); digitalWrite(ledPin, (c == '1') ? HIGH : LOW); } }

void setup() { pinMode(buttonPin, INPUT_PULLUP); jdy.begin(9600); // Match JDY-40 baud rate } jdy-40 arduino example

#include <SoftwareSerial.h> SoftwareSerial jdy(2, 3); // RX = pin 2, TX = pin 3 const int ledPin = 5; void setup() { pinMode(ledPin, OUTPUT); jdy.begin(9600); } void loop() { if (jdy