03-03-2016 08:11 PM
Hi,
i am trying to make a bluetooth communication with my RN42 module and LabView. I have attached the VI with this message. And my arduino code is:
int digPin=9;
void setup() {
pinMode(digPin, INPUT);
Serial.begin(9600);
}
void loop() {
//c=digitalRead(9);
if(Serial.available())
{
//char c = digitalRead(digPin);
char c = analogRead(digPin);
Serial.write(c);
//Serial.write(1);
Serial.print(1);
delay(100);
}
}
I am not able to communicate to my Bluetooth module. Can someone please help me with this.
Thank you.
Regards,
Supreet Juneja
03-04-2016 03:53 AM - edited 03-04-2016 03:56 AM
What problem are you having / what errors are you getting? Have you verified that your bluetooth is actually connected?
(One thing I noticed about your screenshot - generally it is better to use a termination character (e.g. 0xA) in your serial code (e.g. using println) and then use that in your LabVIEW code instead of using bytes at port. Bytes at port might return fewer bytes than you have available.