My LCD screen is giving weird characters (same for Serial monitor).


hey guys,

i'm using bluetooth arduino while , wanted add lcd project, did , when tried print characters in lcd saw weird characters , wasn't working, thought connected wrong, few days later re-connected tried example sketch lcd , yes working good.

now again when use bluetooth lcd screen giving random characters, in serial monitor. i'm lost , think i'm making big mistake...
i use guys! :d

sketch in attachments here:
code: [select]
#include <softwareserial.h>                 // bluetooth library
#include <liquidcrystal.h>
liquidcrystal lcd(12, 11, 10, 5, 4, 13);
int bluetoothtx = 2;
int bluetoothrx = 3;
int gled = 7;                   // led's added
int rled = 9;
int bled = 8;
int leesbt;                     // means readbluetooth
string readstring;
softwareserial bluetooth (bluetoothtx, bluetoothrx);


void setup() {
  pinmode(gled, output);
  pinmode(rled, output);
  pinmode(bled, output);
  serial.begin(9600);
  bluetooth.begin(9600);
  lcd.autoscroll();
  lcd.begin(16, 2);
  lcd.clear();
  lcd.print("welkom!");       // printing welcome
  delay(1000);

}

void loop() {
  while (bluetooth.available()) {
    leesbt = bluetooth.read();
    char c = bluetooth.read();              // when type in mobile phone bluetooth read , print on lcd
    readstring += c;
  }
  if (readstring.length() > 0 && readstring.length() <= 32) {         // if not more 32 characters (total characters lcd can have print it
    lcd.clear();
    serial.println(readstring);
    lcd.print(readstring);
    delay(1000);
  }
  else if (readstring.length() > 32) {        // if more 32 characters give error!
    lcd.clear();
    lcd.setcursor(1, 0);
    lcd.print("error teveel");
    lcd.setcursor(0, 1);
    lcd.print("tekst!");
    delay(1000);
  }
  if (leesbt == '1') {                      // part working fine..
    lcd.clear();
    serial.println("gled aan");
    digitalwrite(gled, high);
    bluetooth.print("1");
    delay(1000);
  }
  if (leesbt == '0') {
    lcd.clear();
    serial.println("gled uit");
    digitalwrite(gled, low);
    bluetooth.print("0");
    delay(1000);
  }
}

some characters serial monitor prints in when type things 'hello'.
http://imgur.com/a/uc66r


Arduino Forum > Using Arduino > Programming Questions > My LCD screen is giving weird characters (same for Serial monitor).


arduino

Comments

Popular posts from this blog

Help needed for choosing soldering station

Error Message when accessing Adobe

Fuelino for Arduino Nano - motorcycle Fuel Injection control and data logger