gm_laserjet - HP Laserjet LCD display changer

As my first thread on FP, I’ve decided to release this module i made for a test one day because i got a free HP Laserjet 4200.

http://img7.imagebanana.com/img/j3xbvn9o/img674.jpg

[lua]
if not laserjet then
require(“laserjet”)
laserjet.SetWidth(20,4) --20x4 LCD (20 chars/line, 4 lines), change if you have a different LCD
laserjet.IPAddress(“192.168.0.20”)
end

function laserjet.SetText(what)
if type(what) == “string” then
what = string.Explode("
", what)
end

local New = ""
for k,v in ipairs(what) do
	New = New..v..string.rep(" ", (laserjet.GetWide() - #v) ) --Width of LCD, set before
end	

return #New, laserjet.WriteString(New) --Raw WriteString, no formatting

end

laserjet.SetText(“This string is
On two lines!”) --String to display, will auto-fit to the screen

local Buff = {
“Players: 4/8”,
“Map: asc_snipe_crazy”,
“Wep: BOOMSTICK!”,
“Kills: 688”,
}

local New,Bytes = laserjet.SetText(Buff) --Or table!

if Bytes then --Total bytes in the packet
print("! sending: “…#New…” chars ("…Bytes…" bytes)")
else
print("! error :(")
end

print( laserjet.GetValue() ) --Current message on the LCD
[/lua]

Download (source included)
http://www.multiupload.com/ECY9EN84DL

You never stop fucking around with all the LCD screens you get do you? This is amazing :smiley:

Yeah… nobody have this printer… :stuck_out_tongue:
Please make one for Arduino :smiley:

Any other printer compatibly with this?

I only have the Laserjet, but it should work with all printers that support HP’s PJL