SoftwareSerial bluetooth(2, 3); // RX, TX
Why SoftwareSerial? The hardware serial pins (0,1) interfere with USB uploading. Using SoftwareSerial allows us to upload code without unplugging the modules. jdy-40 arduino example
To get started with the JDY-40 Bluetooth module and Arduino, you will need the following hardware: you will need the following hardware: