Glcd library suggestion

Post your requests and ideas on the future development of mikroBasic.
Post Reply
Author
Message
Kalain
Posts: 1093
Joined: 11 Mar 2005 18:26
Location: Aubenas, France

Glcd library suggestion

#1 Post by Kalain » 17 Sep 2007 19:50

Hi,

Here is one of Glcd instruction.

Code: Select all

sub procedure Glcd_Write_Text(dim text as char[20], dim x, page, color as byte)
Color variable behaves the same way for all glcd instructions :
Parameter color defines the “fill”:
0 prints “white” letters (clear dots),
1 prints solid letters (put dots),
2 prints “smart” letters (invert each dot).
Well, in graphic terms color = 0 is opposite (complement) to color = 1.
As color is a byte, complement of color =0 is color = 255.
So, it would be useful (and save some Rom) to add 255 in color parameters value. (and will behave same as color =1)
This would be very usefull when passing color value through a byte variable.

Let's give an example :

Code: Select all

Dim state as byte

state = 0
.....
Glcd_Write_Text("Mikroe", 0, 1, state)   ' state = 0
Glcd_Write_Text("has", 0, 2, not(state)) 'state = 255 but behaves same as state = 1
Glcd_Write_Text("good", 0, 3, state)
Glcd_Write_Text("products", 0, 4, not(state))
how does this sounds for mE team?
Alain

Kalain
Posts: 1093
Joined: 11 Mar 2005 18:26
Location: Aubenas, France

#2 Post by Kalain » 18 Sep 2007 07:46

Hi,

I have also tried this example :

Code: Select all

Dim state, run as byte
state = 0
run = not(state.0)  'run bit 0 = 1  this is just to check

Glcd_Write_Text("Mikroe", 0, 1, state)   ' state = 0
Glcd_Write_Text("Mikroe", 0, 1, not(state.0))   

But last Gcld instruction doesn't work. (with not(state.0) )
I guess this is because 'not(state.0)' result is a bit and color has to be a byte. :roll:
Alain

Post Reply

Return to “mikroBasic Wish List”