0

I'm trying to create an Arduino bluetooth remote that can connect with my Mac (and potentially other devices) and basically transmit a few distinct signals back and forth at the push of a button (or Arduino pushbutton). I want to create a remote to control a web app I've built, basically a controller for a game.

I have an Arduino Uno Rev3 starter kit, an RN-42 bluetooth module & a 1sheeld from Google Play, and a Macbook Pro.

Could anyone suggest good guides or online tutorials that can help me set up the communication from Arduino to my computer? Or does anyone have experience with this and would be able to give me some tips?

Bob Gilmore
  • 12,608
  • 13
  • 46
  • 53

1 Answers1

0

It's relatively straightforward.

  • bind the arduino bluetooth to your mac bluetooth.

  • use Serial.* print commands. Normally these go to your computer via USB, but if you have the Bluetooth connected it will go over the Bluetooth connection.

  • the default baud rate of most bluetooth devices is 9600 baud.

So, develop your code the same way as if you were connected via Serial over USB, and it will work without change when you attach the Bluetooth.

Note: Typically USB and Bluetooth will use the same pins, so you can only use one or the other, not both at the same time.

Mark Harrison
  • 297,451
  • 125
  • 333
  • 465
  • Thanks, it makes sense in theory. Only problem is that for my RN-42 my Mac isn't even recognizing the connection. (As in I'm not sure if my bluetooth shield is even trying to connect, despite there being a green flashing LED). Any ideas as to why this is happening? I've set "Serial.begin(9600)" so it should at least be recognizable, correct? – Karan Kashyap Nov 30 '14 at 02:25
  • First thing that should happen is to pair the bluetooth shield to the computer. Not sure of the details for the RN-42, but the Sparkfun page should have some information on doing that. Once it's paired, then you can open the /tty/* device and treat it as a serial port, the same way as a USB serial port. – Mark Harrison Nov 30 '14 at 04:51