Bluetooth - Send text from PC


#1

Hi, I would like to ask you, that how can I send text information from a PC (for example via terminal, like PuTTY) to my mBot Ranger via Bluetooth? I need a code sample for “Arduino” (C++).
I can control and program my Ranger over bluetooth via the mBlock Windows Application when I have the firmware uploaded to the Ranger but I need something like this:

switch(bluetooth.getText())
{
case ‘ledOn’:
//code for turning on the LED
break;
case ‘ledOff’:
//code for turning off the LED
break;
default:
//unknown command
break;
}

I found the library “MeBluetooth.h”, but I only found examples for it where you must input a PORT into the constructor.
The bluetooth module came built-in with the mBot Ranger so if I have to use the MeBluetooth class, then what should I enter into the constructor, and what other things I have to configure? A sample code for the mBot Ranger would be very useful.


Getting started with Arduino C coding with mBot Ranger
#2

Hi faker,

The mBot Ranger comes with this Bluetooth module by default.
The example program Me Bluetooth is for the Me Bluetooth module with RJ25 Port. That’s why there is port in the example program.


The default Bluetooth module for Ranger only supports transmit date between mBot and mBlock software or Makeblock APP, it won’t support other application. If you want to develop it to make it work with your Application, this is really beyond our support ability, hope you can understand.

If you use the Me Bluetooth module with RJ25 port, you can connect it to the Port 5 on the Auriga board and modify the example program Me Bluetooth refer to the README document in the Makeblock library.
image
As for how to make the Me Bluetooth module transmit the date between the me Auriga and your application, you may still need figure it out by yourself.Or maybe someone who has similar personal project can share it.


#3