I am currently working on an Arduino project where the Arduino will send data to a processing program via bluetooth and processing will draw the data. However, my code doesn't seem to work.
Here is my Arduino code:
#include <SoftwareSerial.h>
int bluetoothTx = 1;
int bluetoothRx = 0;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void setup() {
bluetooth.begin(9600);
}
void loop() {
Serial.println("Hello");
}
And here is my Processing code:
import processing.serial.*;
Serial myPort;
void setup() {
myPort = new Serial(this, "COM42", 9600);
myPort.bufferUntil('\n');
}
void serialEvent( Serial myPort) {
String data = myPort.readStringUntil('\n');
println(data);
}
I identified that the incoming port from the HC-05 module is "COM42" from my Bluetooth settings. I am expecting to see several "Hello" lines being printed on the processing console but this does not happen