Can someone help me finish setting up bluetooth on my Teensy3? Right now I get..

Status
Not open for further replies.

RTeensy

New member
the Bluetooth module(JY_MCU) to connect with my android app. The button pressed on the app should turn on led 13 on the teensy but it doesnt seem to be sending data. Any help? I cant be that off from getting this thing working.
 
I've worked with those modules a bit, but it's been a while. They usually work quite well. Please post your <what Wozzy requested above>.
 
Well I have two leds for debugging hooked up to pins 10 and 11. When I press Button A, it should pull pin 10 HIGH, delay, then pull it LOW. I have the JY-MCU module RX-TX1(1), TX-RX1(0), GND-GND, VCC- 3.3V. Here's the code:
int led1 = 10;
int led2 = 11;
int val;

void setup() {
Serial.begin(9600);

pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);

}

void loop() {
if (Serial.available() > 0)
val = Serial.read();

if (val = 'A')
digitalWrite(led1, HIGH);

if (val = 'B')
digitalWrite(led2, HIGH);
}
 
AFAIK, Serial on the Teensy is the USB virtual Serial. Try using Serial1 in your code, that should be the first hardware serial. Is the bluetooth device paired with your android device?
 
Status
Not open for further replies.
Back
Top