Hello everyone,
I used to use an older version of Arduino. But after the updates to version 1.0 and 1.0.1. I'm having difficulties using my serial controlled LCD. I made this topic about it: Serial LCD Functions not working - #8 by system - Programming Questions - Arduino Forum .
After I found Arduino Playground - SparkFunSerLCD .
I figured out how to use the most comon function.
But now I ran into new problems trying to create custom characters.
I have made this code to make this character. Sorry for any dutch commentary.
The serLCD came with the following instructions.
#include <SoftwareSerial.h>
#define rxPin 0
#define txPin 16
SoftwareSerial LCD = SoftwareSerial(rxPin,txPin);
const int LCDdelay = 5;
void lcdPosition(int row, int col) {
LCD.write(0xFE); //command flag
LCD.write((col + row*64 + 128)); //position
delay(LCDdelay);
}
void clearLCD(){
LCD.write(0xFE); //command flag
LCD.write(0x01); //clear command.
delay(LCDdelay);
}
void backlightOn() { //turns on the backlight
LCD.write(0x7C); //command flag for backlight stuff
LCD.write(157); //light level.
delay(LCDdelay);
}
void backlightOff(){ //turns off the backlight
LCD.write(0x7C); //command flag for backlight stuff
LCD.write(128); //light level for off.
delay(LCDdelay);
}
void serCommand(){ //a general function to call the command flag for issuing all other commands
LCD.write(0xFE);
}
void setup(){
digitalWrite(txPin,HIGH);
delay(LCDdelay);
pinMode(txPin,OUTPUT);
LCD.begin(9600);
delay(LCDdelay);
}
void loop()
{
clearLCD();
lcdPosition(1,2);
LCD.print("SPACE INVADERS");
lcdPosition(0,0);
// delay(1000);
//en dan nu; tromgeroffel
//customcharacterdingtest
// LCD.createChar(1, chartest); werktniet, fuck versie >1.0
// customcharacter byte voor byte schrijven
serCommand();
LCD.write(64);//selecteer regel 0
delay(LCDdelay);
LCD.write(1); //input regel 0
delay(LCDdelay);
LCD.write(65);//selecteer regel 1
delay(LCDdelay);
LCD.write(4); //input regel 1
delay(LCDdelay);
LCD.write(66);//selecteer regel 2
delay(LCDdelay);
LCD.write(2); //input regel 2
delay(LCDdelay);
LCD.write(67);//selecteer regel 3
delay(LCDdelay);
LCD.write(31); //input regel 3
delay(LCDdelay);
LCD.write(68);//selecteer regel 4
delay(LCDdelay);
LCD.write(2); //input regel 4
delay(LCDdelay);
LCD.write(69);//selecteer regel 5
delay(LCDdelay);
LCD.write(4); //input regel 5
delay(LCDdelay);
LCD.write(70);//selecteer regel 6
delay(LCDdelay);
LCD.write(1); //input regel 6
delay(LCDdelay);
LCD.write(71);//selecteer regel 7
delay(LCDdelay);
LCD.write(1); //input regel 7
lcdPosition(0,0);
delay(LCDdelay);
LCD.print("test");
delay(LCDdelay);
LCD.write(1);
LCD.print(1);
delay(10000);
}
I think I followed the instructions perfectly, why does my character look completly different then expected?
Any help would be very appreciated.
The function LCD.createChar(0, character) doesn't work, because liquid crystal library doesn't work with serial LCD's.