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)
Well, in graphic terms color = 0 is opposite (complement) to color = 1.Parameter color defines the “fill”:
0 prints “white” letters (clear dots),
1 prints solid letters (put dots),
2 prints “smart” letters (invert each dot).
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))