Jump to content

kellyshen

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. Hi, I have got a hc-05 Bluetooth module, an MSP-EXP430FR4133 board. Now I want to connect them with my computer. However, even I successfully send data from my computer to control the MSP430, it cannot send data back. Can someone tell me what I can do? Here is my code. By the way, I'm using energia for it and set my HC-05 as a slave module. _________________________________________________ // most launchpads have a red LED #define LED RED_LED //see pins_energia.h for more LED definitions //#define LED GREEN_LED void setup() { Serial.begin(9600); /* Define baud rate for serial communication */ pinMode(LED, OUTPUT); } void loop() { if (Serial.available()>0) /* If data is available on serial port */ { char state = Serial.read(); /* Data received from bluetooth */ if (state == '0') { digitalWrite(LED, HIGH); Serial.write("LED turned ON"); state=0; } else if (state == '1') { digitalWrite(LED, LOW); Serial.write("LED turned OFF"); state=0; } } ----------------------------------------------------------------------------------------------------------------------- Waiting for replay! Thank you Kelly
×