Go Down

Topic: Custom character generator for 16x Freetronics LCD+keypad (Read 21770 times) previous topic - next topic


Bzzt. Wrong.

I wrote this app for myself. And offered it, for free, to anyone who wants it.

Non-portability is not a drawback. At all. I couldn't care less if it doesn't work for you or anyone else, I didn't write it for you or anyone else. I wrote it for me.


Ah haha hah hah hah hah.

Arduino kicks ass because it's portable. Inkscape, Gimp, LibreOffice, Steam, MS Office, Blender are but a few other portable apps.
If Arduino was only for linux or macos or windows it would have a much smaller following than it does.

Now get back in your box and stop acting like a petulant child. You made a program and offered it with the hope it would be useful to others. It is and people are happy to have it. I merely pointed out what _I_ perceived as a potential draw-back. Go back and read the words.

You've become snooty and started contradicting yourself. Mate, it's your bat and ball. Why don't ya take em both and go home! And to think, you call yourself a fellow Aussie. Grow up!

We'll see what IDA Pro & DeDe has to say about source...


Great app :) Working on OS X via Wine. However, is it possible to see the custom character in the lines below?


Doesn't seem likely to be possible. (The application makes use of Raize Components - a $399 add-on with a bunch of custom controls.)
Getting sick of clicking each cell individually yet?  XD

If you have a close look at the text-preview window, you can see that there are only 7 vertical pixels. A 1602 of course uses character matrices that are 5x8. They also have a 1 cell gap between each row and between each letter within a row.

It seems that the help for the components are only available if you buy/try them. Only thing is, I haven't programmed in Pascal since the late 90s - but more importantly, it's a 70MB download that wont work with my (ancient) copy of TPW 1.5 - I'm not downloading a 70mb trial just in the hope I'll get the docs.

I've spent a few hours at night over the past week making a couple of native solutions. Both in win32 c (windows or wine only) and wxWidgets c++ (linux, mac, win). If it gives me enough of a kick, I'll crank out a version using MASM too.

Which brings me back to the whole reason I used html5 + javascript in the first place. It's immediately portable - requiring only a html5-capable browser. It's perfectly fine to distribute a single file that constitutes both the application and the source-code. It also means I don't have to go near the horror-show that is Java in order to run it on an Android phone.

The funny thing is, the html version may well end-up being the smallest. Ha! It's 4.7kb,  with a dependancy of the browser. The ASM version will be next, likely weighing in at under 10kb without compression - with zero dependancies. Following that is the win32 C version, that is currently running at about 22kb with 1 or 2 small (sub 100kb) deps. Coming in lucky last are the wxWidgets versions - about 60kb on the Raspberry Pi, 70kb on Linux Mint x64 (dependencies installed in each by default, I think) and a whopping 1.88MB using the static-build of wx under windows. I really should get around to building a dll version of that library..

I'd vaguely considered adding the ability to define an entire font, which would come in far more useful when using a 128x160 lcd.
But currently, learning my way around wxWidgets enough to handle text-input operations in the output preview window. I'm vaguely considering making the lcd control itself editable - i.e you can click a cell to position a cursor there - editing with the keyboard in situ, rather than by a seperate edit window. But then again, I've also considered making the lcdPanel have the same member functions that the LiquidCrystal class does for positioning, custom char definition and text output. That would make a simple 'call' to lcd.print(0) --> lcd.print(7) show any of the custom chars.
Hmm. Actually, as I write this, I may have an idea.

This project is a perfect example of the 80/20 rule in play. You get 80% of the benefit for 20% of the effort. The html one isn't so nice looking, but like I said earlier - I smashed it together during the course of a lunch hour.

I've said it before offline and I'll say it again - the idea to include a preview window was really clever, and one that really dresses up the application.
I wouldv'e left my project gathering dust had it not been for the idea of a preview screen.

Anyway, I'm rambling. I only answer (instead of Aaron) since it looks like he may not be particularly keen to revisit this thread. He or someone else certainly deleted his last post, which was quite an er... ah, 'entertaining' read. :smiley-zipper:


Great app :) Working on OS X via Wine. However, is it possible to see the custom character in the lines below?

Thanks. I wanted to display the custom characters in the lines below, but access to individual pixels is not provided, so it is not possible.

I have been working on lots of other things since. Given LCD screens are roughly the same price as a HC06 BT module and 99% of Android phones have BT built in, I'm unlikely to ever need LCD screens or LCD custom characters again.


Great app, no doubt about it, but can you se the build character in the lines?
If you could that would be an amazing app!

Thanks. No, I looked and it's not possible.


It's often interesting what a week or two will do to one's perspective.
Sorry for the trouble Aaron. I only intended to offer constructive criticizm. Unfortunately the tone plummeted from the time I received your response.

Since coming across this thread, I've taken Aaron's superb feature of a live-preview and added it to the quick hack that I wrote.
I've also had the chance to try wxWidgets for more than the cursory 'Hello World' - something I've not bothered with since first trying Qt some 6 or 7 years ago. Custom controls using wxWidgets are so much more re-usable than anything made with the win32 api or MFC.

Anyway, I implemented theming and the ability to preview your own custom characters. The controller used for 1602s only allows for 8 custom characters, while I've not imposed such a limitation. It makes it more flexible and frees you from the way that various OSs handle some characters.
The easiest way to preview, is to select characters that won't appear in the display text and simply re-assign their bitmaps - you can preview the entire supplied font,

I've tried to make the theming mechanism as flexible as possible. Just add another colour theme to the array and the code will create the required CSS and select-element options at run-time. Similarly, it should be an equally easy task to add a different output method/format.

The code uses html5, so you need to use a browser that will support among other things, the canvas element. The stock browser on Android 2.3.4 phones works just fine. IE9 is happy too. Enjoy..




Looks  great - well done. You need a "copy to clipboard" button or something to copy the output code to er yeah the clipboard.


You should also allow the user to select



And create your own thread so it can stand apart from my pitiful attempt. Definitely your own thread. You need to move out from my shadow and stand in the sunshine, son.


Thanks Aaron.

Yup, definitely lazy with regards to a copy-to-clipboard feature and different sized displays. It sure has been 'interesting' keeping 3 different versions of the same thing synchronized - win32, wxWidgets and html.

Your attempt is great, nothing wrong with it. The check-boxes make it 'a little' difficult to draw by dragging the mouse. But this is more than redeemed for me by the preview feature.

I'm not trying to cause trouble here, just being honest - every time I hear of pascal these days, I can't help but think of the following terms:
"Niklaus Wirth", "Quiche" and "The story of Mel" - an astute googler will find them all in the same page. I find them here: http://www.pbm.com/~lindahl/real.programmers.html
That said - I really, really don't wish to cause offence. That bunch sound like something of a cross between lumber-jack, mechanic,(red-neck) 'man' and members of an elitist group. But the Story of Mel has given me a great chuckle for over 20 years now, I guess you've no doubt read it. It's too good not to share, I reckon.

Thank-you for the suggestions. :thumbs-up: I'll look at bashing them out and into their own thread over the weekend when I get some time.


Aug 22, 2013, 12:34 pm Last Edit: Aug 22, 2013, 12:36 pm by aarondc Reason: 1
el oh el.

Real programmers eh? If only we had an ignore function. Last time I wanted to do that I wrote my own forum-specific browser. In Pascal.


Aug 22, 2013, 12:49 pm Last Edit: Aug 22, 2013, 12:52 pm by enhzflep Reason: 1
Oh come now, I realize the page title sucks, but the content is rather a giggle, masochistic programmers indeed. The fact that MEL's boss asked him to do one thing with the video game (allow it to let the player win more often) yet he did another thing (made it win more) is hilarious. As is the whole 'down-the-rabbit-hole' affair that was the investigation of Mel's placing of instructions in specific places to allow the drum to rotate most of a revolution in order to provide a 'code-less' delay. I taught myself to program in assembly, using nothing more that an assembler, a debugger and a dissassembler - perhaps that's why I find the stories regaled within so funny.

Fortunately, browsers supply a rich-enough plug-in interface now that the easiest way to achieve a custom experience of a website is to write a browser plugin. Either a native one NPAPI or a javascript one - a grease-monkey script or (for chrome) a CRX.

I've gone the CRX route before, it makes using websites with obtrusive ads, nasty colour themes, poor formatting etc, etc much nicer to play with.
Also has the advantage of being very quick to re-work when the underlying structure changes. You can also easily trim parts from the page that are posted by er, um, pests. :) :runs-away:

EDIT: Just saw your edit. :ear-to-ear-grin: - that's the spirit!


Aug 22, 2013, 12:53 pm Last Edit: Aug 22, 2013, 12:54 pm by aarondc Reason: 1
Nowhere near as much as fun writing a browser from scratch. Well, maybe not rendering the page, but firing off individual file requests for images, css, etc, and caching same however you want, where you want.


Go Up