The other day I bought myself a USB bluetooth dongle for my HP laptop and a HC-05 bluetooth adapter for the Arduino.
When I connected the dongle to my laptop running Windows 8 it appeared like it would install the default drivers for it. I connected the HC-05 to an Arduino and I could locate it from my laptop. I could even pair the dongle with the adapter. (Default code: 1234.)
But when checking the HC-05 in Windows’ device manager its status would say “Offline”. It took me several hours of googling until I came across a suggestion by another user that bought the same dongle on amazon: I installed the Toshiba Bluetooth Stack! Even though it says it’s only for toshiba laptops it worked on my HP like a charm.
I also had a HC-06 adapter lying around. Optically they look very similar. As far as I know HC-05 can work as master or slave whereas HC-06 is slave only. If you use them as slaves you can use either of them using the same pins. HC-05 came up under COM40 and HC-06 identifies itself as “linvor” under COM41.
I always wanted to start programming in Processing. And when I came across the Dimmer example in Arduino’s example folder and I saw that there was also some Processing code I decided that this would be my first Processing, Arduino and bluetooth project.
I extended the Dimmer Processing code with a red, green and blue gradient strip. In the example was already the gradient from black to white. The idea was to dim a LED and also to control a RGB led from the GUI.
For the bluetooth connection I set up a software serial port on Arduino. I connected the RX of this software serial to the TX pin of the HC-05/HC-06. As the bluetooth module works with 3.3V levels I set up a voltage divider using a 10k poti. The TX of the software serial would be connected to HC-05/06 RX pin using that voltage divider so it would not get levels over 3.3V.
Please find the code in my GitHub repository.