Hello!
I am having issues getting data from arduino to processing through a hc-06 bluetooth module.
In this case I am just trying to get simple data across.
arduino code:
int i=0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.write(i);
i++;
delay(200);
if(i>255){
i=0;
}
}
processing code:
import processing.serial.*;
Serial myPort;
int val=0;
void setup()
{
println(Serial.list());
String portName = Serial.list()[1];
myPort = new Serial(this, portName, 9600);
}
void draw(){
if ( myPort.available() > 0) {
val = myPort.read();
println(val);
delay(100);
}
}
I recognized and added the HC-06 module on my laptop, and it created 2 (?) com ports, in my case 6 and 7. My arduino is listed as COM 3. When I print the available coms, I only get 3 and 7. When I select 3, I get the data but its through the cable, when I select 7 I get nothing.
Wiring:
vcc - 3.3v
grnd - grnd
tx- rx
rx - tx
Help is much appreciated!