Bridge commands between Serial and software serial Bluetooth modules.
Open in compiler →/*
Roboda verified Arduino sample 0422
Feature: Bluetooth Serial
Generated for online build, classroom practice, and hardware upload testing.
*/
#include <SoftwareSerial.h>
SoftwareSerial bluetooth(10, 11);
void setup() {
Serial.begin(9600);
bluetooth.begin(9600);
}
void loop() {
if (Serial.available()) {
bluetooth.write(Serial.read());
}
if (bluetooth.available()) {
Serial.write(bluetooth.read());
}
}
How it works
Practice this Arduino feature with a verified Roboda sketch.
- Read the constants at the top of the sketch.
- Wire the pins exactly as listed in the pin map.
- Upload or compile once before changing values.
- Change one value at a time and watch Serial Monitor or the output device.
Connections
| Pin | Connect to | Note |
|---|---|---|
| D10 RX, D11 TX | Bluetooth/Wi-Fi module TX/RX crossed | Use voltage division or level shifting when a 3.3V module receives Arduino 5V TX. |