Hi friends, I need some help with a highschool project. I want to use a LCD Display to show a text in movement. Also, I want to use AT Commands in my HC-05 module, all of this connected to a Arduino UNO. It works fine at first, but when I try to write the AT Commands in the Serial Monitor, it begins to show the word "ok", many times.
This is my code: It works ok, expect of the Serial Monitor:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>
LiquidCrystal_I2C lcd(0x3F,16,2);
SoftwareSerial BTserial(2, 3);
char c = ' ';
void setup()
{
{
Serial.begin(9600);
Serial.println("Arduino with HC-05 is ready");
BTserial.begin(38400);
Serial.println("BTserial started at 38400");}
{
lcd.init();
lcd.backlight();
lcd.setCursor(3, 0);
lcd.print("FF-CF=0,5 mts, CF-C9=1 mt, C9-C5=1.5 mts, C5-BD=2 mts, BD-B9=2.5 mts");
}
}
void loop()
{
// Keep reading from HC-05 and send to Arduino Serial Monitor
if (BTserial.available())
{
c = BTserial.read();
Serial.write(c);
}
// Keep reading from Arduino Serial Monitor and send to HC-05
if (Serial.available())
{
c = Serial.read();
// mirror the commands back to the serial monitor
// makes it easy to follow the commands
Serial.write(c);
BTserial.write(c);
}
{
lcd.scrollDisplayLeft();
delay(700);
}
}