![]() If not already paired, click on discover and wait for the device to appear in the list below. ![]() Click connect on the main screen of the app. ![]() Turn on power to your circuit so that the LED on the Bluetooth module starts flashing. Wrap this with the '*' code and receive character, we haveĪ message that will be understood by the android 'Bluetooth electronics' app.ġ) Run the Bluetooth Electronics app, click edit.Ģ) Select library and navigate to the Ultrasonic Distance Sensor demo and copy to panel.ģ) Now connect to the Bluetooth device. These values are prefixedīy 'R', 'G' or 'B' and strung together in a string. Specified by an integer between 0 and 255. Tell the app where the end of the string is so that it can start processing the command.įor the Light indicator, the amount of red, green and blue is The string is also terminated with a “*” to This 'receive character' can be set in the Edit screen This case a Time indicator, a Distance indicator and a Light that is set either On which indicator on the Android device we want the information sent to (In The strings sent over Bluetooth begin with “*T”, “*D” or “*L” depending Micro seconds that the echo pin was held HIGH into the variable echotime. Pin goes HIGH and stops counting when it goes LOW again, returning the time in echotime =pulseIn(echo_pin, HIGH) starts counting when the echo The pulseln() command returns the time in microseconds that a pin is high The delayMicroseconds() command is used to hold the trigger pin high for 10 ms. Copy and paste the above sketch and click upload. Select the correct COM Port and Arduino device in the To two serial devices simultaneously on the same pins. Module otherwise the Arduino will get confused trying to communicate To program the device, make sure you remove pins 0 and 1 to the Bluetooth Ultrasonic Distance Sensor Demo // By keuwlsoft: 16th Sept 2015 // cc Attribution-ShareAlike // // This sketch controls a HC-SR04 Ultrasonic Distance sensor on pins 8 & 9 // The distance is calculated and sent over using an HC-06 Bluetooth module // Keuwlsofts 'Bluetooth Electronics' App is used to view the results int trig_pin = 8 int echo_pin = 9 long echotime //in micro seconds float distance //in cm void setup ( )
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |