Hello,
I tried to follow a way through SLCD - Serial LCD library (Arduino Playground - SLCD) and I tried to upload this code to the board :
void setup()
{
Serial.begin(9600);
backlightOn();
}
void loop()
{
selectLineOne();
delay(100);
Serial.print(millis());
selectLineTwo();
delay(100);
Serial.print(millis()/2);
delay(100);
}
void selectLineOne(){ //puts the cursor at line 0 char 0.
Serial.print(0xFE, BYTE); //command flag
Serial.print(128, BYTE); //position
}
void selectLineTwo(){ //puts the cursor at line 0 char 0.
Serial.print(0xFE, BYTE); //command flag
Serial.print(192, BYTE); //position
}
void goTo(int position) { //position = line 1: 0-15, line 2: 16-31, 31+ defaults back to 0
if (position<16){ Serial.print(0xFE, BYTE); //command flag
Serial.print((pos+128), BYTE); //position
}else if (position<32){Serial.print(0xFE, BYTE); //command flag
Serial.print((pos+48+128), BYTE); //position
} else { goTo(0); }
void clearLCD(){
Serial.print(0xFE, BYTE); //command flag
Serial.print(0x01, BYTE); //clear command.
}
void backlightOn(){ //turns on the backlight
Serial.print(0x7C, BYTE); //command flag for backlight stuff
Serial.print(157, BYTE); //light level.
}
void backlightOff(){ //turns off the backlight
Serial.print(0x7C, BYTE); //command flag for backlight stuff
Serial.print(128, BYTE); //light level for off.
}
void serCommand(){ //a general function to call the command flag for issuing all other commands
Serial.print(0xFE, BYTE);
}
...but I had these errors :
hardware\libraries\SLCD\SLCD.o: In function `c':
/Users/ianmcdougall/Applications/arduino-0011/hardware/libraries/SLCD/SLCD.cpp:68: undefined reference to `HardwareSerial::print(char)'
/Users/ianmcdougall/Applications/arduino-0011/hardware/libraries/SLCD/SLCD.cpp:69: undefined reference to `HardwareSerial::print(char)'
hardware\libraries\SLCD\SLCD.o: In function `SLCD::print(char const*)':
/Users/ianmcdougall/Applications/arduino-0011/hardware/libraries/SLCD/SLCD.cpp:94: undefined reference to `HardwareSerial::print(char const*)'
hardware\libraries\SLCD\SLCD.o: In function `SLCD::sendControl(char)':
/Users/ianmcdougall/Applications/arduino-0011/hardware/libraries/SLCD/SLCD.cpp:111: undefined reference to `HardwareSerial::print(char)'
/Users/ianmcdougall/Applications/arduino-0011/hardware/libraries/SLCD/SLCD.cpp:112: undefined reference to `HardwareSerial::print(char)'
hardware\libraries\SLCD\SLCD.o: In function `SLCD::print(char const*, int, int)':
/Users/ianmcdougall/Applications/arduino-0011/hardware/libraries/SLCD/SLCD.cpp:87: undefined reference to `HardwareSerial::print(char const*)'
Couldn't determine program size: D:\ARDUINO\arduino-0012\hardware/tools/avr/bin/avr-size: 'D:\ARDUINO\arduino-0012\hardware\libraries\SLCD\examples\slcd_demo\applet\slcd_demo.hex': No such file
avrdude: can't open input file D:\ARDUINO\arduino-0012\hardware\libraries\SLCD\examples\slcd_demo\applet\slcd_demo.hex: No such file or directory
avrdude: write to file 'D:\ARDUINO\arduino-0012\hardware\libraries\SLCD\examples\slcd_demo\applet\slcd_demo.hex' failed
Ok, maybe it's because it specify a wrong way to my folder : /Users/ianmcdougall/Applications/arduino-0011/. I think the file
SLCD.o contains the wrong way (not mine). How could I modify ".o" files?
Any idea??? :-?