Using a HC-05 bluetooth module I cannot enter commands with Serial Monitor (serial monitor hangs) but Tera Term seems to work with this script
char INBYTE;
int LED = 13; // LED on pin 13
void setup() {
Serial.begin(9600);
pinMode(LED, OUTPUT);
}
void loop() {
Serial.println("Press 1 to turn Arduino pin 13 LED ON or 0 to turn it OFF:");
while (!Serial.available()); // stay here so long as COM port is empty
INBYTE = Serial.read(); // read next available byte
if( INBYTE == '0' ) digitalWrite(LED, LOW); // if it's a 0 (zero) tun LED off
if( INBYTE == '1' ) digitalWrite(LED, HIGH); // if it's a 1 (one) turn LED on
delay(50);
}
I've set the baud rate appropriately, I think I must have because tera term seems to work at that baud.
Any ideas? Alternatively is there a way of making tera term behave more like serial monitor? i.e inputting a string of commands which are sent when you press the return key.