Bluetooth module for Flora?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Bluetooth module for Flora?
Not familiar with the HC-06.
- Franklin97355
- Posts: 23912
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Bluetooth module for Flora?
What does the HC-06 need for power and inputs?
-
- Posts: 5
- Joined: Wed Jul 02, 2014 11:15 am
Re: Bluetooth module for Flora?
SLAVE mode only
3V OPERATION (5V will not work)
4PIN connector
4PINs are Vcc, GND, DO (TX), DI (RX)
It powers up, and I can connect with it, however, not communication is transmited.
I'm trying to run this example: https://www.youtube.com/watch?v=W5okUciwFkI
3V OPERATION (5V will not work)
4PIN connector
4PINs are Vcc, GND, DO (TX), DI (RX)
It powers up, and I can connect with it, however, not communication is transmited.
I'm trying to run this example: https://www.youtube.com/watch?v=W5okUciwFkI
- Franklin97355
- Posts: 23912
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Bluetooth module for Flora?
Could you show us how you have it connected and post the code you are running?
Please use the code button on the reply form.
Please use the code button on the reply form.
-
- Posts: 5
- Joined: Wed Jul 02, 2014 11:15 am
Re: Bluetooth module for Flora?
This is the code, image is attached.
[img] [/img]
[img] [/img]
Code: Select all
#include <SoftwareSerial.h>
char receivedChar;
int LED = 13; // LED on pin 13
SoftwareSerial mySerial(10, 11); // RX, TX
int sensorPin = A0;
void setup()
{
// Open serial communications and wait for port to open:
pinMode(LED, OUTPUT);
mySerial.begin(115200);
mySerial.println("Welcome to the wonderful world of bluetooth communication");
delay(1000);
mySerial.println("Sending a '1' will turn on the LED, Sending a '0' will turn off the LED");
delay(1000);
mySerial.println("a '3' will flash the LED and a '4' will kick out a lot of data from the LDR");
}
void loop() // run over and over
{
while (!mySerial.available()); // stay here so long as COM port is empty
receivedChar = mySerial.read();
if (receivedChar == '1') {
digitalWrite(LED, HIGH);
}// if it's a 1 turn LED on
if (receivedChar == '2') {
digitalWrite(LED, LOW);
} // if it's a 2 turn LED off
if (receivedChar == '3') {
for (int i = 0; i < 30; i++) {
digitalWrite(LED, HIGH);
delay(20);
digitalWrite(LED, LOW);
delay(20);
}
} // if it is a 3 flash the LED
if (receivedChar == '4') {
for (int i = 0; i < 100; i++) {
delay(20);
int sensorValue = analogRead(sensorPin);
float voltage = sensorValue * (5.0 / 1023.0);
mySerial.println(voltage);
}
} // if it is a 4 print out lots of sensor data
}
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Bluetooth module for Flora?
Those connections to your Flora are not secure enough for data transmission. Either solder then, or use alligator clip leads between the wires and the pads
-
- Posts: 5
- Joined: Wed Jul 02, 2014 11:15 am
Re: Bluetooth module for Flora?
Soldered version
[img] [/img]
Yesterday I connected the HC-06 bluetooth module with an arduino UNO and it worked, I also connected Flora with a LED and run the blink example, however together they seem to fail.
[img] [/img]
Yesterday I connected the HC-06 bluetooth module with an arduino UNO and it worked, I also connected Flora with a LED and run the blink example, however together they seem to fail.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Bluetooth module for Flora?
Possible your HC-06 needs to be powered with 5V? What happens if you power it from the 3.3v pin on the Uno - does it still work?
Also, you should be using Serial1 with the Flora, not Serial
Also, you should be using Serial1 with the Flora, not Serial
-
- Posts: 5
- Joined: Wed Jul 02, 2014 11:15 am
Re: Bluetooth module for Flora?
Thanks a lot, it was the Serial, using Serial1 works fine.
-
- Posts: 3
- Joined: Mon Jul 14, 2014 7:34 am
Re: Bluetooth module for Flora?
Can I ask for more information in this scope? Can I use ICSP ports on Flora for communication with Bluefruit nrf8001? I can find burning new bootloader using this one only. I would like to start from adapting code presented here for arduino:adafruit wrote:in *theory* the flora can drive the nrf8001 but we don't have support or code for it so its not suggested except for super advanced users. we're working on a BTLE for the flora but no ETA at this time!
https://learn.adafruit.com/getting-star ... -in-detail
Am I going in right direction?
-
- Posts: 3
- Joined: Mon Jul 14, 2014 7:34 am
Re: Bluetooth module for Flora?
Sorry if I'm missing something, but that link I've pasted says bluefruit BLE nrf8001 is working over SPI (check the pinout section). So still, my questions from previous post remain.
if it is possible to connect flora to it (as mentioned by adafruit) what would be connection schema? would SCK, MISO, MOSI, RST pins from nrf8001 go to Flora ICSP header, and
REQ to Flora D10, RDY to some interrupt enabled flora pin - not sure which :(
Thanks,
if it is possible to connect flora to it (as mentioned by adafruit) what would be connection schema? would SCK, MISO, MOSI, RST pins from nrf8001 go to Flora ICSP header, and
REQ to Flora D10, RDY to some interrupt enabled flora pin - not sure which :(
Thanks,
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Bluetooth module for Flora?
Yes, you can connect the nRF8001 by following the Leonardo instructions. D2 is interrupt-capable
-
- Posts: 3
- Joined: Mon Jul 14, 2014 7:34 am
Re: Bluetooth module for Flora?
Thanks for answer! D2 isn't exposed for Flora, I used SDA instead with success.
Regards,
Regards,
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Bluetooth module for Flora?
Actually, SDA is D2!
-
- Posts: 1
- Joined: Sun Jul 20, 2014 1:17 pm
Re: Bluetooth module for Flora?
Hi,
I'm also using the same HC-06 module and it properly pairs with a device(android phone) but messages are not getting displayed on arduino1.0.5 serial terminal and there are no LEDS which blinking when a particular message is sent.I use the same code as shown in the above example. Regarding the Serial1, where exactly should this be added?. Also what are the RX and TX pin numbers on Flora?. This is the code:
Thanks in advance!
I'm also using the same HC-06 module and it properly pairs with a device(android phone) but messages are not getting displayed on arduino1.0.5 serial terminal and there are no LEDS which blinking when a particular message is sent.I use the same code as shown in the above example. Regarding the Serial1, where exactly should this be added?. Also what are the RX and TX pin numbers on Flora?. This is the code:
Code: Select all
#include <SoftwareSerial.h>
char receivedChar;
int LED = 13; // LED on pin 13
SoftwareSerial mySerial(10, 11); // RX, TX
int sensorPin = A0;
void setup()
{
// Open serial communications and wait for port to open:
pinMode(LED, OUTPUT);
mySerial.begin(9600);
mySerial.println("Welcome to the wonderful world of bluetooth communication");
delay(1000);
mySerial.println("Sending a '1' will turn on the LED, Sending a '0' will turn off the LED");
delay(1000);
mySerial.println("a '3' will flash the LED and a '4' will kick out a lot of data from the LDR");
}
void loop() // run over and over
{
while (!mySerial.available()); // stay here so long as COM port is empty
receivedChar = mySerial.read();
if (receivedChar == '1') {
digitalWrite(LED, HIGH);
}// if it's a 1 turn LED on
if (receivedChar == '2') {
digitalWrite(LED, LOW);
} // if it's a 2 turn LED off
if (receivedChar == '3') {
for (int i = 0; i < 30; i++) {
digitalWrite(LED, HIGH);
delay(20);
digitalWrite(LED, LOW);
delay(20);
}
} // if it is a 3 flash the LED
if (receivedChar == '4') {
for (int i = 0; i < 100; i++) {
delay(20);
int sensorValue = analogRead(sensorPin);
float voltage = sensorValue * (5.0 / 1023.0);
mySerial.println(voltage);
}
} // if it is a 4 print out lots of sensor data
}
Please be positive and constructive with your questions and comments.