Simple TX/RX setup with Bluetooth

Hi there,
Sure , look at the recomended examples posted to start.
The first thing would be to use one Xiao in the expansion base (BLE Central) and one as the transmitter (BLE peripheral) to control the LEDS & Grove connector connected to a motor control board or directly depending on the load it presents on the expansion base.
Basically you’ll have two sketches , One for each device.
I would recommend the tiny grove expansion board for the Transmitter (this easily accepts push button & potentiometer )
Use one of the DEMO’s I posted as a outline for the BLE basic advertising the led service or battery service load that on the expansion board Xiao. get it advertising so you can see it on the NRF_connect for Desktop and The BLE Dongle. (first step)
LMK if that’s clear or if you need more info.
BTW what you want to do is very basic once the steps are in place.
HTH
GL :slight_smile: PJ

Look this over :v:

see how the botton and buzzer , etc. connect up?

Found this:
One of the first BLE sketches, works with the Expansion board.
Compile and try it.

#include <ArduinoBLE.h>
#include <U8x8lib.h> 
BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // Bluetooth® Low Energy LED Service
 
// Bluetooth® Low Energy LED Switch Characteristic - custom 128-bit UUID, read and writable by central
BLEByteCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);
 
const int ledPin = LED_BUILTIN; // pin to use for the LED
 U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* clock=*/ PIN_WIRE_SCL, /* data=*/ PIN_WIRE_SDA, /* reset=*/ U8X8_PIN_NONE);
// OLEDs without Reset of the Display
const int buttonPin = D1;     // the number of the pushbutton pin
int buttonState = 0;
int BuzzerPin = A3;           //A3 , P0.29 PIN 4
int buzzer = BuzzerPin;


void setup() {
  Serial.begin(9600);
  while (!Serial);
// set LED pin to output mode
 pinMode(ledPin, OUTPUT);
 Serial.println("Processor came out of reset.\n");
 u8x8.begin();
 u8x8.setFlipMode(1);   // set number from 1 to 3, the screen word will rotary 180
 //Serial.println("BLE LED Peripheral");
  u8x8.setFont(u8x8_font_8x13B_1x2_r);
    u8x8.clearDisplay();
    u8x8.setCursor(0,3);
    u8x8.print("BLE Peripheral");
       
 pinMode(buttonPin, INPUT_PULLUP);// initialize the pushbutton pin as an input:
 pinMode(BuzzerPin, OUTPUT);
 pinMode(LEDR, OUTPUT);
 pinMode(LEDG, OUTPUT);
 pinMode(LEDB, OUTPUT);
  // begin initialization
  if (!BLE.begin()) {
    Serial.println("starting Bluetooth® Low Energy module failed!");
 
    while (1);
  }
 
  // set advertised local name and service UUID:
  BLE.setLocalName("BASIC-LED");
  BLE.setAdvertisedService(ledService);
 
  // add the characteristic to the service
  ledService.addCharacteristic(switchCharacteristic);
 
  // add service
  BLE.addService(ledService);
 
  // set the initial value for the characeristic:
  switchCharacteristic.writeValue(0);
 
  // start advertising
  BLE.advertise();
 
  Serial.println("BLE LED Peripheral");
}
 
void loop() {
  // listen for Bluetooth® Low Energy peripherals to connect:
  BLEDevice central = BLE.central();
 
  // if a central is connected to peripheral:
  if (central) {
    Serial.print("Connected to central: ");
    // print the central's MAC address:
    Serial.println(central.address());
 
    // while the central is still connected to peripheral:
  while (central.connected()) {
        if (switchCharacteristic.written()) {
          if (switchCharacteristic.value()) {   
            Serial.println("LED on");
            digitalWrite(ledPin, LOW); // changed from HIGH to LOW       
          } else {                              
            Serial.println(F("LED off"));
            digitalWrite(ledPin, HIGH); // changed from LOW to HIGH     
          }
        }
      }
 
    // when the central disconnects, print it out:
    Serial.print(F("Disconnected from central: "));
    Serial.println(central.address());
  }
}

LMK