You can then use the serial monitor in the IDE to interact with the shield and configure it in the way you need it. Once you have at least the first set of those bits of information you can write some software for the Arduino which will pass anything received on Serial through to the bluetooth shield, and anything received from the bluetooth shield back through to Serial. What the baud rate is which you need to use to communicate.What the AT command set of the module is.This should be available from wherever you purchased it. To progress you really need the manual for the shield. Nothing will happen until you have configured the shield using AT commands.Communication with the Arduino is done through UART serial, and the pins used for that communication are selected using the big bank of jumpers.The shield can run in two modes: AT command mode, which is used to configure it, and Transparent UART mode, which is used to communicate.You need to understand the basics before you try running code to "do things": PinMode(2,INPUT) pinMode(13,OUTPUT) attachInterrupt(0,cleantime,FALLING) init_timer2() Ĭase 1: digitalWrite(13,HIGH) Serial.print("Hellow BT") break Īnybody can help me decipher this code? none of this looks familiar to me Unsigned int timeout=0 unsigned char state=0 ĪSSR |= (0<<AS2) // Use internal clock - external clock not used in Arduino UPDATE 2: Here is the code from the PDF that was shipped with my shield: (THE LED IS GREEN, IT'S CONNECTED ON MAC AND ON BLUTERM) I connect it to the HC-05 BUT it doesn't send me anything back. I want to send these 1's and 0's through a Mac program called Bluterm. that uses a 1 to turn a led on and a 0 to turn it off. I have this serial program that I want to use to turn on a led.īut I can't seem to enter AT mode, or get any indication that besides it connecting to my Mac it's receiving or transmitting any signals.Īnybody got any tips for tutorials/tips for tests for a MAC OSX user? and enter the "AT" to test the communication between BT shield and the USB port.ĥ.Set the switch "S1" on both shield to "HW" side, and set the switch "S2" to "SLAVE" on one shield and another to "MASTER" side.Ħ.The State LED always being on indicate that the two shield are connected.ħ.The connection is successful now, and you can type characters on the Serial monitor and send to each.Does anybody know how I can get it to connect to Arduino? The following figure shows users how to use jumpers to configure UART communication between BT Shield and Arduino.Ĭommunication between two Bluetooth Shield Hardware neededġ.Stack the Bluetooth shield to the Arduino Uno.Ģ.Program a simple code as blink without delay for your Arduino UNO first to avoid the serial communication conflict.ģ.Set the jumpers to connect the BT_TX and BT_RX pins as the photo above to enable PC com port to send AT command to Bluetooth shield directly as the photo belowĤ.Open the com port of your Arduino UNO with the setting of baudrate 9600. Users must be aware that which Digital pin of Arduino connects to BT_TX needs to act as Arduino RX pin(Hardware/Software), and which connects to BT_RX needs to act as Arduino TX pin(Hardware/Software). Users can use the jumpers to connect the BT_TX and BT_RX pins(5V) of Bluetooth shield to any Arduino. S3: The switch S3 is for master/slave selection only if the S2 is toggled to "HW" side. When the switch S2 is toggled to "SW" side means the master/slave mode is only decided by AT command "AT+role0/1" When the switch S2 is toggled to "HW" side indicate that you can set the module to either master or slave mode by switch S3. S2: The switch S2 is for hardware/software selection for master or slave mode. S1:Function button, This button is a multi-function button include the function memory clearing (short press) which means deleting the address of the bluetooth module connected last time.Another function is to restore the default configuration(long press over 3s).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |