Pages: [1]   Go Down
Author Topic: Blink one line on 16x2 display  (Read 917 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am making a timer with a 16x2 LCD display, and I want to have one of the rows blink saying "Active" while its active.
Would I have to print and then remove it each time it blinks, or is there a way to disable individual rows?
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4257
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Would I have to print and then remove it each time it blinks, ...
Yes.

Quote
... or is there a way to disable individual rows?
No.

Both answers assume that when you refer to 16x2 you are also referring to one driven by an Hitachi HD44780 or compatible controller.  And, as mentioned above, it's no real problem for an Arduino.


Don
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Don,
Just want to "challenge" your answer with a ridiculous answer that will do the job but is harder to do and at the same time offers more features if used properly.

Since the HD44780 display has 8 custom character spaces, one can print on second line 012345 (first 6 of the 8 custom characters). Then customize these 6 characters to look like "Active", then customize them to look like "      ". You can do other stuff too, such as rolling the "Active" up one pixel at a time in circular buffer or simply roll them out and start again. It's definitely not the easiest but may offer features the easy way doesn't offer smiley-wink

It's the old-school color palette trick.
Logged


Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4257
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Then customize these 6 characters to look like "Active", then customize them to look like "      ".
I don't quite follow you but it looks like you are rewriting the memory contents one way or another.  I think he wants to leave the memory contents the same and just turn the display of them on and off which can't be done using the inherent instructions.  The closest you could get is to shift them horizontally out of view, but this would shift the other line as well.

Don
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Then customize these 6 characters to look like "Active", then customize them to look like "      ".
I don't quite follow you but it looks like you are rewriting the memory contents one way or another.  I think he wants to leave the memory contents the same and just turn the display of them on and off which can't be done using the inherent instructions.  The closest you could get is to shift them horizontally out of view, but this would shift the other line as well.

Don

Here is what I mean:

Let's say the OP wants to display A (Active is too long as example) and blink it by displaying space over A then display A again to form a blinking A. OP needs to repeatedly print to the same cursor position with A, then space, then a, ...

My solution is to print custom character 0 where A should be. Then define the custom character to look like a, say with this array
byte custom_0_A[]={4,10, 17,17,63,17,17,0};

The above looks like A.

Then the OP redefine the same character as:
byte custom_0_space[]={0,0,0,0,0,0,0};

By sending this new definition, the A is erased.

Then the OP can repeat, define char 0 as custom_0_A, then define it as custom_0_space. The LCD memory is not changed, but the custom character memory is changed instead. The OP can also decide to define char 0 as:
byte custom_0_half_A[]=(0,0,0,4,10,17,17};
etc. and could animate this cell.

I'll pull out my arduino from my suitcase and hopefully give a demo.
Logged


Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

But your example is EXACTLY identical to writing "A" and then writing " " (blank).  Except, of course, that you don't have to fool around defining characters.

I could make a bunch of A's for an animation of an A scrolling up. smiley-wink
Apparently this can be done on as many as 8 unique characters and a long of free time to kill. smiley-wink

Like this one, except you will be animating a character instead of arrow.

http://liudr.wordpress.com/2011/03/08/arduino-character-art-on-lcd/
Logged


Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4257
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The LCD memory is not changed, but the custom character memory is changed instead.
You are just using substituting one of the LCD memory locations for another.  You are using CGRAM (Character Generator RAM) to define your custom character data instead of getting the regular data out of CGROM (Character Generator ROM).  In either case the data is copied to DDRAM (Display Data RAM) and displayed on the screen.

Don
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The LCD memory is not changed, but the custom character memory is changed instead.
You are just using substituting one of the LCD memory locations for another.  You are using CGRAM (Character Generator RAM) to define your custom character data instead of getting the regular data out of CGROM (Character Generator ROM).  In either case the data is copied to DDRAM (Display Data RAM) and displayed on the screen.

Don

Yes Don. That was exactly what I suggested. I guess I was changing DDRAM after all.
Logged


Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That's pretty impressive. Is that part of your library?
Thanks. I didn't make any library. It is as of now just a complete project code. You are welcome to use the code.
Logged


Pages: [1]   Go Up
Jump to: