PDA

View Full Version : Teensy 3.0 Connect with BlueSMiRF



NaN
01-16-2013, 10:49 PM
Hi, I've been trying to get my teensy 3.0 to communicate with my bluesmirf bluetooth module.
I've followed the instructions on the following page but am unable to get receive or transmit through the bluetooth module.

Teensy 3.0 Uart Real Serial Port - http://www.pjrc.com/teensy/td_uart.html
Bluesmirf Bluetooth module - https://www.sparkfun.com/products/10269

I've tried RX/TX 1-3 and changing the serial values but haven't seen any change in the function.

neep
01-21-2013, 07:55 PM
I had trouble hooking up a HC-05 bluetooth module to a Teensy 3 as well. It initially worked on an Arduino Uno, as described here:

http://www.instructables.com/id/Cheap-2-Way-Bluetooth-Connection-Between-Arduino-a/

I have a 5V bluetooth module, but the RX/TX is 3.3V. I verified this with a multimeter. I've connected RX/TX to ports 0/1 on the Teensy 3. I had to make some changes to the sketch provided in the link above. And this actually works for me:



char INBYTE;
int LED = 13; // LED on pin 13

HardwareSerial bt = HardwareSerial();

void setup() {
pinMode(LED, OUTPUT);

bt.begin(9600);
bt.println();
}

void loop() {
bt.println("Press 1 to turn Arduino pin 13 LED ON or 0 to turn it OFF:");
while (!bt.available()); // stay here so long as COM port is empty
INBYTE = bt.read(); // read next available byte
if( INBYTE == '0' ) digitalWrite(LED, LOW); // if it's a 0 (zero) tun LED off
if( INBYTE == '1' ) digitalWrite(LED, HIGH); // if it's a 1 (one) turn LED on
delay(50);
}