A little curiosity. A whole lot of making.Robotics, CNC & connected ideas
robodatech.
Arduino sample library

Bluetooth Serial 34

Bridge commands between Serial and software serial Bluetooth modules.

Open in compiler →
/*
  Roboda verified Arduino sample 0847
  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.

  1. Read the constants at the top of the sketch.
  2. Wire the pins exactly as listed in the pin map.
  3. Upload or compile once before changing values.
  4. Change one value at a time and watch Serial Monitor or the output device.

Connections

PinConnect toNote
D10 RX, D11 TXBluetooth/Wi-Fi module TX/RX crossedUse voltage division or level shifting when a 3.3V module receives Arduino 5V TX.

Good ideas start here.

Robotics lessons, build notes and useful updates. Subscribe by entering your email.