Hexiwear team to share code, project ideas, trick and tips

Drawing on the OLED - not filling whole screen

19 Aug 2016

I've been working on making a library for drawing on the OLED (although now I see your a step ahead of me @KenneyHuang ;) ) https://developer.mbed.org/users/keithm01/code/Hexidraw/

For the most part it works, I used the Adafruit GFX library and the OLED driver in the Kinetis project as references for making sure to set everything correctly.

I'm having issues though where I'm trying to draw a rectangle to fill the screen, but it's not filling the whole screen, a slice about 32px wide isn't filling on the right side.

/media/uploads/keithm01/win_20160818_18_26_38_pro.jpg

I've checked through the afford mentioned references, and they pretty much match up aside from my function combining a few functions in the OLED Driver for Kinetis.

Any ideas on why it's not filling in the whole screen?

I haven't had to deal with OLEDs at this low-level much before, so thank you for any help!

19 Aug 2016

I've determined that everything is being offset to the left about 16 pixels like the NiceGUI library does, strange. I've initialized the OLED with the register values that the Kinetis project uses, so I don't think it's that.

19 Aug 2016

Sure enough adding 'x+= 16' in the rect function before drawing the rect is now drawing it in the correct position. I'm gonna dig into the register values to see if I have an offset wrong somewhere.

19 Aug 2016

After doing a little more digging, it looks like even the official Hexiwear code includes a 16px column offset. wonder if it's an issue with the driver that makes the offset necessary. Even when the registars are initialized for 96x96, it still has the issue.