Different LCD display

16 replies [Last post]
mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012

I have a few LCD displays, some long (64 chars x 2 lines) some short (16 chars x 1 line) and (16 chars x 2 lines).

I thought I may be able to use these with the HAH but putting a 2 line display just causes the text to split over the 2 lines. I've had a look for the LCD bit of code but struggling.....any pointers?

I would like to use a 16x2 display to show a little more information

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
LCD
mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
Thank you

I spent a lot of time looking through the files on the HAH but never thought to look at the source for the hah_microcontroller but with hindsight.....

Thanks again

mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
I now have a 20x4 LCD display

I now have a 20x4 LCD display hooked up to the HAH. It's taken me a while to get it to work (or so I thought), investigating the initialisation and the addressing of the lines of display.

A word of warning, if you buy a Powertip PC2004 display from CPC or Farnell be warned, it may be an extended temperature range display, in which case it needs a -ve supply for the contrast pot, not just +5V and GND.  Mine currently has ~-1.5V on the Vo (contrast) input.

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Hi Mark, how do the 20x4 LCD

Hi Mark,

 

how did the 20x4 LCD work out for you?

was possibly thinking about doing the same

cheers

Andy

mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
20 x 4 display

Hi Andy

It works BUT the code for the box has a 30 character buffer and some of those are used for control, so you can only display 25characters. All that is needed is to edit the code and recompile but at the moment I don't have the time available to go down that route to get the display working when it spends most of it's time hidden away under the stairs ticking away.

Maybe over the Christmas period I'll have another look :)

Unless of course you'd like to do it for me :)

I've hinted to Derek but he's not taken up the challenge yet ;)

Mark

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Hi Mark,thanks for the reply,

Hi Mark,

thanks for the reply, thats interesting to know, i may go for a 2x16 line display over a 4x20 in that case - was looking at the blue backlite with white text and mounting the HAH in a nice black alu case to allow it to fit in with my other home kit

still playing with setting up RF and Roomnodes so will look into compiling the code in a bit

thanks

 

Andy

brett
Offline
Providence, United States
Joined: 9 Jan 2010
xap-livebox now has 128 char LCD buffer.

I updated the xap-livebox in the BETA to have a 128 character lcd buffer.  The web interface was not changed but you should be able to drive this directly with an XAP message as long as you've made the appropriate changes in your AVR firmware.

Get the beta and let me know how it goes.  I also corrected the weather applet weather-applet-help-required in /etc_ro_fs/plugboard/samples

# /etc_ro_fs/update-dev hah-beta.dbzoo.com

CAVEAT:  Read about code changes to the penlight library in 307-1

Brett

mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
Cheers BrettI'll give it a

Cheers Brett

I'll give it a try over the weekend and let you know.

I've already changed the AVR firmware and was going to look at changing this over Christmas but you've saved me HAVING to do it. I will anyway just so I can prove to myself that I can :)

I've just used one of my spare roomnodes to convert a resistive touchscreen to work on an old machine that had a 10 x 8 cell touchscreen :) gotta keep those old machines going...

mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
UPDATE:Box updated and the

UPDATE:

Box updated and the display is now fully working...so is everything else too.

Cheers Brett

mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
Second update:Everything fine

Second update:

Everything fine except the feeds from two of my three active roomnodes.

They seem to be getting very strange readings. The outside temperature today was varying between 3 and 25 degrees.

here is my entry for jeenodesApplet;

[2] = RoomNode{base="dbzoo.livebox.jeenode:livingroom", endpoints = {temp=1,lobat=1,light=1,moved=1}, ttl=900},
[3] = RoomNode{base="dbzoo.livebox.jeenode:conservatory", endpoints = {temp=1,lobat=1,light=1,moved=1}, ttl=900},
[4] = RoomNode{base="dbzoo.livebox.jeenode:gas-monitor", endpoints = {temp=1,lobat=1,light=1,moved=1,humi="count"}, ttl=900},

Feed 2 working fine

Feed 3 giving what looks like a ramped feed

Feed 4 same as 3

I have seen the comment about the penlight changes but I don't seehow it applies

do I change RoomNode = require("xap.roomnode").RoomNode to RoomNode = require("xap.roomnode") ?

sorry but been a long week :)

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Thanks Brett, Mark, do you

Thanks Brett,

 

Mark, do you have any info on modifying the AVR ? - where do i start :)

 

Thanks

 

Andy

mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
I used Arduino program

I used Arduino program (google is your friend). The file I edited originally was liveboxHAH, it has the LCD width and height but although I changed it to 20 width and 4 height I could only get 25 chars to display, that was down to the firmware only allowing 30 or so characters.

The latest firmware beta 307.1 has been modified by Brett to give us 128 characters. I have tried it but I'm having issues with the roomnodes so I've rolled back to 307

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Fixed penlight library in 307.1 causes jeenodes to break.

Mark,

I was very puzzled over the jeenodes breaking,  as mine were hanging off my joggler and I'd not gotten around to switching them back to the livebox I thought I do this and see what happens with 307.1.  To my suprise they didn't work properly !?

After lots of head scratching I finally figured out why.

The penlight library that has been in place since i implemented the plugboard had two functions in the STRINGX library for justification and these are broken.  They work backwards.

print("RIGHT JUSTIFY "..stringx.rjust("110",8,"0"))
print("LEFT JUSTIFY "..stringx.ljust("110",8,"0"))

RIGHT JUSTIFY 11000000       <--- this is technically a left justitication.
LEFT JUSTIFY 00000110         <--- and this is really a right justification.

If you run the same code for the new library this would now output.

RIGHT JUSTIFY 00000110    <-- and that is correct.
LEFT JUSTIFY 11000000      <-- so is this.

BUT all the code in the HAH was written to workaround that BROKEN library so when I uplifted the penlight library in 307.1 my code suddenly was all wrong, as the bug had been fixed in the library itself.

Anyway long story short 307.2 fixes this problem and I'm now running this myself with the jeenode off of the livebox and its happy again.

Brett

mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
307.2

Cheers Brett.

I'm glad you found it, I don't think I would this side of christmas :)

I've just upgraded to 307.2. The roomnodes appear to be ok and so far everything else too.

Thanks for the work Brett, as always

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Thanks Brett & Mark

Thanks Brett & Mark

 

mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
Thanks for the thanks.

Thanks for the thanks.

I'm glad it worked for you too. Like you I need to sort some code to write to the whole LCD or a way to position the cursor before writing.

Hardware Info