Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 14:16 23 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : LCD code

     Page 1 of 2    
Author Message
James_From_Canb

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 265
Posted: 04:16am 09 Jul 2011
Copy link to clipboard 
Print this post

I thought I'd start an LCD thread with a more generic name.

I've attached my latest LCD code for 16 x 2 and 20 x 4 line LCDs.

This version has:
a LOCATE subroutine
Values held in arrays so it's easier to write generic code
Some example code so you can see what can be done
An example of moving the cursor to a line and column (it writes a 'Z')
An example of writing a character from the LCD character table (the Ohm character)
An example of scrolling a message normally, and how the screen looks (horrible)
Some custom code to scroll a very big message across a single line.

Before you use it, change the constants at the top of the code so they match the number of lines and the screen width of your LCD screen.

You can also change the initial messages displayed on the LCD screen. If you have a 20 character wide screen, pad the messages out with spaces to make them 20 long, otherwise you get odd characters displayed.

I wasn't able to load all the code using the Attach Code option, so I've attached it in a zipped file.

James
Edited by James_From_Canb 2011-07-10
My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention.

Hedley Lamarr, Blazing Saddles (1974)
 
Ray B
Senior Member

Joined: 16/02/2007
Location: Australia
Posts: 219
Posted: 07:03am 09 Jul 2011
Copy link to clipboard 
Print this post

James were all excited but I for one can't see any attachment. Try again maybe.
RayB from Perth WA
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 07:16am 09 Jul 2011
Copy link to clipboard 
Print this post

James, unfortunately there is no attachment.

Stuart
Time is nature's way of keeping everything from happening all at once.
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 07:17am 09 Jul 2011
Copy link to clipboard 
Print this post



I have just set up a Basic Program Storage Page:

http://www.themaximitecomputer.com/submit-basic-program/

Cheers Don...

https://www.dontronics.com
 
BobDevries

Senior Member

Joined: 08/06/2011
Location: Australia
Posts: 266
Posted: 07:18am 09 Jul 2011
Copy link to clipboard 
Print this post

Ray,

It's strange that the code is missing here on the forum. I get notifications of the forum activities in my email, and the post from James included the code (not sure if it's all there, though), yet when I login here, I can't see any code at all.

Regards,

Bob Devries
Dalby, QLD, Australia
 
Ray B
Senior Member

Joined: 16/02/2007
Location: Australia
Posts: 219
Posted: 07:22am 09 Jul 2011
Copy link to clipboard 
Print this post

Bob can you see my other post of a couple of minutes ago where I posted a PDF File under Programming Manuals ?
RayB from Perth WA
 
BobDevries

Senior Member

Joined: 08/06/2011
Location: Australia
Posts: 266
Posted: 07:22am 09 Jul 2011
Copy link to clipboard 
Print this post

oh, and the code I have ends with line 30280.
Is that all there was, James?

Regards,

Bob Devries
Dalby, QLD, Australia
 
James_From_Canb

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 265
Posted: 07:27am 09 Jul 2011
Copy link to clipboard 
Print this post

When I first posted it, I clicked on the "include code" button. The code must have been too big because it wasn't all included, so I edited the posting to remove the code and (thought I) uploaded the zipped file.

You would have seen the cut-off version of the code when you received the notification, and it would have been gone by the time you clicked on the link.

By the way, I was posting a reply and loading up the zip file at the same time as either Don or Bob were replying to the thread. My PC hung. It never hangs. I had to power off and restart.

Anyway, here's the zipped file. I'll put it on Don's site too.

James

2011-07-09_172557_LCD_4x20_V2.zip
My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention.

Hedley Lamarr, Blazing Saddles (1974)
 
James_From_Canb

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 265
Posted: 07:31am 09 Jul 2011
Copy link to clipboard 
Print this post

Don, there's a problem with your upload page. It says :

"To Submit your Maximite Basic Program, Please"

then nothing else.
My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention.

Hedley Lamarr, Blazing Saddles (1974)
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 07:35am 09 Jul 2011
Copy link to clipboard 
Print this post

  James_From_Canb said   Don, there's a problem with your upload page. It says :

"To Submit your Maximite Basic Program, Please"

then nothing else.


After that is says "Email Me", however it is java script to stop spammers.

you have Java script enabled?

I may have to put a note there, or change it.

Also as Glenn suggested, there may be many variants, but I think it really need a single zip file and a spot to place it.

That is all we need.

Cheers Don...
Edited by donmck 2011-07-10
https://www.dontronics.com
 
BobDevries

Senior Member

Joined: 08/06/2011
Location: Australia
Posts: 266
Posted: 07:40am 09 Jul 2011
Copy link to clipboard 
Print this post

Ray,
I did receive your post about the PDF file, and I read it online also.
I downloaded the PDF file.

Regards,

Bob Devries
Dalby, QLD, Australia
 
Ray B
Senior Member

Joined: 16/02/2007
Location: Australia
Posts: 219
Posted: 07:50am 09 Jul 2011
Copy link to clipboard 
Print this post

Excellent offering James - Runs well on my MM well over in Perth. Good to see somthing good coming out of Canberra

Thanks Don for hosting a library site.




RayB from Perth WA
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 07:53am 09 Jul 2011
Copy link to clipboard 
Print this post

  Ray B said  

Thanks Don for hosting a library site.



No worries, I just have to fine tune it so that it is working :-)

Cheers Don...
https://www.dontronics.com
 
James_From_Canb

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 265
Posted: 07:57am 09 Jul 2011
Copy link to clipboard 
Print this post

  donmck said  

After that is says "Email Me", however it is java script to stop spammers.

you have Java script enabled?



No, I don't. I use NoScript, a Firefox add-on, to stop scripts unless I specifically allow them.

You are now a fully trusted site, and I can see the Email Me.

I submitted it, but the Maximite is going to make categories difficult. It's software, but it's controlling hardware, and it's an interface. I reckon you'll end up with multiple categories per submission.
My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention.

Hedley Lamarr, Blazing Saddles (1974)
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 08:11am 09 Jul 2011
Copy link to clipboard 
Print this post

  James_From_Canb said  
  donmck said  

After that is says "Email Me", however it is java script to stop spammers.

you have Java script enabled?



No, I don't. I use NoScript, a Firefox add-on, to stop scripts unless I specifically allow them.

You are now a fully trusted site, and I can see the Email Me.

I submitted it, but the Maximite is going to make categories difficult. It's software, but it's controlling hardware, and it's an interface. I reckon you'll end up with multiple categories per submission.


I use no-script also, so I know what you mean. I hope the big red text does the job, if not we will have to be more informal and do the old "me AT somewhere.com" thing.

Categories. I can only leave that in the hands of the submittee. (is that a word?)

OK, your email came through.
I guess we can address it now.

Two cats, software and LCD interface?

is it is giving us a circuit of the interface and driving software?

How about "Software-Hardware-Combination" ?
Then we make a sub dir under that as: LCD
Would this cover it for the one file?

We will work through it all :-)

Cheers Don...





https://www.dontronics.com
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 08:17am 09 Jul 2011
Copy link to clipboard 
Print this post


Ashurley, I have just done this, tell me if it is wrong.

http://www.themaximitecomputer.com/Basic-Programs/

Cheers Don...
https://www.dontronics.com
 
Ray B
Senior Member

Joined: 16/02/2007
Location: Australia
Posts: 219
Posted: 08:25am 09 Jul 2011
Copy link to clipboard 
Print this post

James ideally a graphic at the top of the code would go down well. The attached is from some PicAxe LCD Code which I've attached as a good example of how code should be laid out. One extra addition that someone mentioned the other day in this forum with documenting code is to also put in comments explain the inputs to a sub routine and what is returned.

One problem putting in graphics is with the font people use as if they are not a proportional font then the graphic goes haywire.


2011-07-09_182027_LB_Essential_LCD_Driving_Code_V4.pdf

*
RayB from Perth WA
 
James_From_Canb

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 265
Posted: 10:05am 09 Jul 2011
Copy link to clipboard 
Print this post

OK Ray. I have one 'tick in the box'. Just. I described the inputs needed for the LCD LOCATE, and there's no output.

I **think** the "Code" option uses a non-proportional font, so it should be OK for diagrams that are posted on the forum but, as you say, anything in the zipped files may have issues.

That attached PicAxe LCD Code has had a lot of work done on it. I think that level of documentation is too formalised for development code, but really good for a completed project.

That also brings up the issue of programming standards. I see that Geoff has a consistent naming standard. There should be some agreed naming standards for submitted code, particularly to distinguish constants from variables.
My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention.

Hedley Lamarr, Blazing Saddles (1974)
 
VK6MRG

Guru

Joined: 08/06/2011
Location: Australia
Posts: 347
Posted: 06:58am 10 Jul 2011
Copy link to clipboard 
Print this post

How much would you pay for an LCD?
$3.50USD 1x16 or 2x16 LCD
maybe $8USD 2x20 LCD
or maybe $9.50, $14.50USD delivered. 4x20 blue LCD.
Does this sound like a good deal?
Its easier to ask forgiveness than to seek permission!

............VK6MRG.............VK3MGR............
 
James_From_Canb

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 265
Posted: 07:09am 10 Jul 2011
Copy link to clipboard 
Print this post

  VK6MRG said   How much would you pay for an LCD?
$3.50USD 1x16 or 2x16 LCD
maybe $8USD 2x20 LCD
or maybe $9.50, $14.50USD delivered. 4x20 blue LCD.
Does this sound like a good deal?


I paid around $5 each for some second hand 8x2s about 2 years ago, so all of those sound like good deals.
The 4x20 blue one I ordered from the depths of China was AU $9.58 delivered.
Here's the link. Or buy through a local retailer and support people who provide spec sheets.

Some come with the 16 pin headers (I think that's the right term).

Some even have the 16 pins pre-soldered, but cost more.

James
My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention.

Hedley Lamarr, Blazing Saddles (1974)
 
     Page 1 of 2    
Print this page
© JAQ Software 2024