To amuse myself, I'm trying to learn how to control the 20x4 crystalfontz lcd myself. At the moment I'm using Perl, as it's a quick language. Anyway, I can't for the life of me figure out how to control the backlight... Sample program:
#!/usr/bin/perl
use FileHandle;
open (LCD, ">/dev/ttyS0");
LCD->autoflush();
sleep(3);
print LCD "Hello World";
print LCD "\014\020"; # back light to 20% .. from .pdf
sleep(6);
close (LCD);
exit 0;
Obviously, the syntax that I'm using must not be correct. Does anyone have any suggestions?
#!/usr/bin/perl
use FileHandle;
open (LCD, ">/dev/ttyS0");
LCD->autoflush();
sleep(3);
print LCD "Hello World";
print LCD "\014\020"; # back light to 20% .. from .pdf
sleep(6);
close (LCD);
exit 0;
Obviously, the syntax that I'm using must not be correct. Does anyone have any suggestions?
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.