Maybe it is nonsense this but, is there a contrast control? I had an issue once on LCD with this.
Ioannis
Maybe it is nonsense this but, is there a contrast control? I had an issue once on LCD with this.
Ioannis
thanks but no, there is no contrast control. if anyone has any ideas let me know. i'll post if I ever figure it out
Hi Guys
Can anyone help! I am trying to get this code to work with a 16f88 and a 128x32 OLED.
I'm using Richards code with a small 0.96" 128x32 OLED display, soft I2C (because the 18F46K42 doesn't have the "old" MSSP module).
I've managed to print text and variables on the screen but in order to update those values without clearing the whole screen I'm trying to figure out how to use the GLCD_CLR command to clear an area.
I can make it do something but what it does doesn't make much sense to me. It seems to be pixel by row based but still, it's acting weirdly on me.
For example, with the following screen as a starting point:
GLCD_CLR 0,0,5,1 or GLCD_CLR 0,0,10,1 does absolutely nothing while GLCD_CLR 0,0,10,2 does this:
GLCD_CLR 10,0,40,1 does this (which is reasonable, clearing a section of 30pixels wide, 1 row high):
While GLCD_CLR 10,0,41,1 does this:
I'm also getting strange results with the GLCD_BAR command. Anyone knows/understands what's going on here? Am I using it wrong or have I stumbled across an issue?
/Henrik.
Well, it turns out I don't have to worry about manually blanking out "stuff" - it just works. Still curious about the GLCD_CLR though.
henrik
there is a great probability i never tested it to any great extent , was just happy that it cleared to whole screen at a default setting
this works for one line as i intended things to [you need to work around the limited size of the data buffer glcd_buff]
two linesCode:gx=5:gx_=32:gy=0:gy_=0 ; clear from x=5 for 32 bits one line gosub setxy j=0 for i=0 to gx_ glcd_buff[i]=0 ;by default the buffer is 32 bytes so be wary next glcd_rad=gx_ gosub ssd_data
you may be able to figure out why the command fails , i'm just not seeing it at the present timeCode:gx=5:gx_=32:gy=0:gy_=1 gosub setxy j=0 for i=0 to gx_ glcd_buff[i]=0 next glcd_rad=gx_ gosub ssd_data gosub ssd_data
Last edited by richard; - 14th March 2021 at 00:56.
Warning I'm not a teacher
try this
Code:glcd_clrxy: ' clear area x1y1 to x2 y2 FOR GRX = 0 TO 31 glcd_buff[GRX] = glcdData NEXT CTEMP = (1 + GX_ - GX)*(1 + GY_ - GY) gosub setxy glcd_rad=32 for GRX = 0 to CTEMP/32 gosub ssd_data next glcd_rad = CTEMP//32 IF glcd_rad THEN gosub ssd_data ENDIF return
Warning I'm not a teacher
Thank you Richard!
Replacing the glcd_clrxy subroutine with that from post #38 seems to have fixed it.
It also seems to have made GLCD_BAR more predictable but I have not looked into how they're interconnected.
I also got the two Label after column 1 warnings (GLCDS_BAR_?CCBWC) etc but it turns out that there's a whitespace infront of those two macro labels on the include file. There was also an ELSE in column 1 causing another warning.
I need to spend some time trying to figure out how it does it's things, would like to be able to add a slightly larger font for example. Guessing I need to replace/change the unpack routine - at the very least.
This SSD1306-driver saved me alot of time, much appreciated Richard!
/Henrik.
Bookmarks