Go Down

Topic: Control BlinkM led via Bluetooth (Read 709 times) previous topic - next topic

encryptor

I'd like to control the BlinkM led via Bluetooth wireless.  I'm using the following code to start.  Currently I have BlinkM plugged into Vin -> +5v, GND -> GND, d = A4 (SDA), c = A5 (SCL).  How can I alter this code so I can give commands via the serial monitor configured to the BT port (COM5 SPP) and BT baud rate (115200) and have it be recognize by the Arduino Pro?  When performing the experiment the Arduino Pro would only receive power using a 12v power adapter (barrel jack port) and the A-B serial cable would be disconnected.
peace*&^

HazardsMind

So whats not working? What are you using to send the commands to and from the computer? What program, Putty, Hyperterminal,or something else?
Did you do a run a test to see if the two communicate before starting a project? Write a bare basic, simple program to continously send out "TEST" from the arduino, through the BT module and see if the computer gets "TEST" back. If it doesn't then there is a setup problem.
Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

encryptor

What's not working is supplying commands to affect the led.  The pic may be deceiving since BlinkM is lit, however the bluetooth module led is not green meaning it is not paired with the PC.  Previously, I have successfully performed a test to prove BT is communicating over RX/TX on Arduino Pro and it used Arduino Serial Monitor to print counter result.  I was thinking to still use the Serial Monitor to type in my commands.  I'm confuse how to use both UART and I2C together.  The sketch loading on the board now was attached to the original post, but it doesn't implement the BT technology I have connected.  Thanks.
peace*&^

HazardsMind

That BT module use I2C or RX/TX?
If it is RX/TX, then use software serial. If it is I2C then lookup some sample codes to get it to work with the Wire library. I haven't used I2C with bluetooth before, so im not sure how to code it myself. But just do a search for I2C bluetooth and see what you get.
Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

encryptor


That BT module use I2C or RX/TX?
If it is RX/TX, then use software serial. If it is I2C then lookup some sample codes to get it to work with the Wire library. I haven't used I2C with bluetooth before, so im not sure how to code it myself. But just do a search for I2C bluetooth and see what you get.


The BT module uses RX/TX.  The BlinkM is I2C.  I will investigate further. any help is appreciated.
peace*&^

Go Up