libsureelec, a driver for Sure Electronics LCD displays

IMAG0227.jpg

A few months ago I got a pair of 4x20 LCD displays from Sure Electronics, via eBay. Though they worked quite happily through LCDproc, I didn't really want to use that (as I intend to use one of them on a Bifferboard). To that end, I've attempted to write a driver for them. Until recently I didn't have a lot of success, which made me think that the documentation provided with the device was incorrect, until Gordon suggested trying the command set through gtkterm. I did, which made it work, and discovered that it requires the entire line to be sent to the display even if you're only updating part of it. Adjusting my code to handle this, and add some sleep time after sending each command, made it work.

I've put the code on Github in case anyone else is interested. It's able to drive my DE-LD023 device quite happily, but I suspect it should work for other 4x20 devices too. Once I add the code to detect the device features it should also work for different sized displays. Any comments or patches are of course welcome.

Speaking at DPC10

DPC10 speaker badge

I'm happy to say that I'll be speaking at the Dutch PHP Conference in June in Amsterdam, on the subject of the PECL/Cairo extension I've been helping out by working on for the past few months. This will be my first appearance as a speaker at a technical conference so I'm a little nervous, but I've no doubt I'll be practicing a bit before it happens. Apologies in advance to anyone I inflict the talk on before the event.

Debug of the year

I saw this article on the BBC, where a man who bought a packet of cigarettes from a petrol station in the US ended up being charged $23,148,855,308,184,500 instead. Wow. I was a little curious as to how this could have happened, though the number didn't look familar - I know roughly what 2^32, 2^32 / 2, 2^64, 2^64 / 2 look like, and this didn't appear to be any of those. A swift Google though led me to Stack Overflow, which is a fantastic site. Therein lies a quite plausible explanation:

Add the cents to the number and you get 2314885530818450000, which in hexadecimal is 2020 2020 2020 1250.

Do you see the pattern? The first six bytes has been overwritten by spaces (hex 20, dec 32).

Ingenious! I can imagine spending quite a while trying to come up with that...

PHP 5.3.0RC2

PHP 5.3.0RC2 has been released, which means that the next version of PHP is just around the corner. It comes right in the middle of the annual PHP Testfest. I rambled on a bit on the Freenode podcast a couple of weeks ago about this - it's an annual project where PHP usergroups and individuals around the world get together to improve the unit testing of PHP. This has benefits for everyone involved - PHP is improved, and more likely to maintain backward compatibility, and the people involved in writing the tests get to contribute in a meaningful way to the project, and hopefully learn something on the way. Several usergroups have events scheduled, and a couple have already taken place to great success. If you're a serious PHP user, and interested in getting involved, it's well worth checking out.

Even just grabbing the latest PHP release, compiling it on your platform, and running "make test" helps the project. It doesn't take much to do, and you can run it in the background while doing something else. Go for it!

My favourite ever dialogue box

I saw this on TheDailyWTF recently, and decided I had to try it for myself, and it works!

the-best-dialogue-box-ever.png

You get it if you go to "Clear History" in the "Go" menu in Nautilus.

 1 2 Next →

About

User