Mbot Ranger with bluetooth


#1

Hello guys, I just bought an mbot ranger, and it has a bluetooth module the one with the “c” at the end, but I cannot manage to connect to it with serial bluetooth, I can however see that it broadcasts a BLE signal Makeblock_LE001b1066c24e, but i cannot send/receive any info, this is the code I used:

#include "MeAuriga.h"
#include <SoftwareSerial.h>

MeBluetooth bluetooth(PORT_5);

unsigned char table[128] = {0};

void setup()
{
  Serial.begin(9600);
  bluetooth.begin(9600);    //The factory default baud rate is 115200
  Serial.println("Bluetooth Start!");
}

void loop()
{ 
  int readdata = 0,i = 0,count = 0;
  char outDat;
  if (bluetooth.available())
  {
    while((readdata = bluetooth.read()) != (int)-1)
    {
      table[count] = readdata;
      count++;
      delay(1);
    }
    for(i = 0;i<count;i++)
    {
      Serial.write(table[i]);
    }
  }
  if(Serial.available() )
  {
    outDat = Serial.read();
    bluetooth.write(outDat);
  }
}

#2

Hi there:

PC and laptop need to use Makeblock Bluetooth dongle to connect with our machine,mobile device and Mac can use bulit-in Bluetooth fuction to connect with ranger and upload the codes or using Makeblock app to control the ranger.