-
Notifications
You must be signed in to change notification settings - Fork 0
Home2
Eloi Stree edited this page Dec 22, 2018
·
2 revisions
- Getting Stated With HC 06
- PDF GUuide 2BT
- Bluetooth Electronics
- Bluetooth Terminal
- Buy HC06
- Unity Android & Microcontrollers
http://forcetronic.blogspot.com/2014/08/getting-started-with-hc-06-bluetooth.html
Params > bluetooth > Pair device "HC-06"
Install Blue Term (Don't seem to work for me)
https://youtu.be/DI6Oda6fsSY?t=317
[Sena BTerm](https://play.google.com/store/apps/details?
id=com.sena.bterm)
void setup () {
Serial.begin(9600);
}
void loop() {
if(Serial.available())
Serial.print((char)Serial.read());
}
Try by me
https://youtu.be/jR4wX7GF9gQ?t=166
- Bluetooth Electronics Basicly it is a interface ui that allow to send letter in the terminal from image. Cool to prototype without coding. /!\ Still need to push a Arduino Script
(Unwatch yet)
https://youtu.be/7XdSGU_W4ho
/*
* Bluetooth HC-06 (SLAVE) control from your Android phone RSB May 2016
*/
#include "Arduino.h"
#include <SoftwareSerial.h>
// Instantiate our BT object. First value is RX pin, second value TX pin
// NOTE: do NOT connect the RX directly to the Arduino unless you are using a
// 3.3v board. In all other cases connect pin 4 to a 1K2 / 2K2 resistor divider
/*
* ---- pin 6-----> |----1K2----| to HC06 RX |----2K2----| -----> GND
*
* See my video at www.youtube.com/c/RalphBacon for more details.
*/
SoftwareSerial BTserial(4, 6); // RX , TX
// Our output indicator (could drive an opto-isolated relay)
byte LEDpin = 8;
// -----------------------------------------------------------------------------------
// SET UP SET UP SET UP SET UP SET UP SET UP SET UP SET UP SET UP
// -----------------------------------------------------------------------------------
void setup() {
// LED output pin
pinMode(LEDpin, OUTPUT);
// Serial Windows stuff
Serial.begin(9600);
Serial.println("Set up complete");
// Set baud rate of HC-06 that you set up using the FTDI USB-to-Serial module
BTserial.begin(9600);
}
// -----------------------------------------------------------------------------------
// MAIN LOOP MAIN LOOP MAIN LOOP MAIN LOOP MAIN LOOP MAIN LOOP
// -----------------------------------------------------------------------------------
void loop() {
// If the HC-06 has some data (single char) for us, get it
if (BTserial.available() > 0) {
// Get the char
char data = (char) BTserial.read();
// Depending on value turn LED ON or OFF (or error message)
switch (data) {
case '1':
Serial.println("ON");
digitalWrite(LEDpin, HIGH);
BTserial.write("ON");
break;
case '0':
Serial.println("OFF");
digitalWrite(LEDpin, LOW);
BTserial.write("OFF");
break;
default:
Serial.print("NOT RECOGNISED: ");
Serial.println(data);
BTserial.print("Error!");
}
}
}
Source: Ralph S Bacon
/*This sketch Configures the name and baud rate of an HC 06 Bluetooth module */
char message1[10];//need length of chars being read +1 for null character
char message2[9];
void setup() {
// set baud rate then delay to give user time to open serial monitor
Serial.begin(9600);
delay(5000);
//Send command to set name of HC06 module, with the below command name will change to "forcetronics"
Serial.print("AT+NAMEForceT");
delay(600); //HC06 requires 500 msec for reply
int8_t count = 0; //declare and intialize count
while(1) { //loop until OKsetname is read and cleared from buffer
if(Serial.available()) {
message1[count] = Serial.read(); //read in char
count++;
if(count == 9) break; //after we get all 9 char break out of loop
}
delay(10);
}
//Send AT command to change baud rate to 115200
Serial.print("AT+BAUD8");
delay(600); //HC06 requires 500 msec for reply
count = 0; //intialize count
while(1) { //loop until OK115200 is read and cleared from buffer
if(Serial.available()) {
message2[count] = Serial.read();
count++;
if(count == 8) break;
}
delay(10);
}
//print out each message to make sure it worked
Serial.println("");
Serial.println(message1);
Serial.println(message2);
}
void loop() {
//do nothing
delay(50);
}
"Workshop to learn to use HC-06 Bluetooth under Unity by creating a remote fireworks launcher station for safety and fun"
EN - FR
Additionnal:
- Other tutorial
- Pro Fireworks Ways
- Fun in the Danger Zone
- Firework Youtubers
- HC06 Youtuber
- Use a leap battery
Some Youtube playlists on the subject I was studying for this experiment