Connect computer to Redbear Duo via Bluetooth


I want to let a button (connected to the Redbear Duo) interact via bluetooth with a Java program I wrote. If you push on the button, a signal needs to be send to the computer.
The problem I have is to make the bluetooth work on the Redbear. I don’t know how to implement it in my code in Arduino IDE.
This is the very basic code I have:

#if defined(ARDUINO)

const int greenbutton = D8;
const int greenbuttonlight = D9;

// variables will change:
int PressGreen =0;

void setup() {
// put your setup code here, to run once:


void loop() {
// put your main code here, to run repeatedly:
int PressGreen = digitalRead(greenbutton);
digitalWrite(greenbuttonlight, HIGH);
Serial.println(“LED on”);
} else{
Serial.println(“LED off”);


How can I send a signal over bluetooth to my computer when the button is pushed?


This is a good question. I have not done it successfully, yet. I thing there are some things to consider. Please someone correct me if I am wrong.

The Duo uses BLE (Bluetooth low energy) while computers usually use BT (Normal Bluetooth). As Far as I know these are not compatible. An option I would like to try is the BLE dongle

I think maybe using a BLE Nano connected to the computer would work too. However, remember that Bluetooth has its own ways of connecting computers (not as easy as Master-Slave). So maybe you need to consider this too.