• 0
CraigA

PMOD OLED Driver Multiple Rectangles

Question

Hello!

I'm using an Arty-S7 with a PMODOLED.  I want to draw several rectangles on the little display, but the example design seems to delete the previous rectangle when I add a new one.  Is there some magic to display multiple rectangles or do I need to dig deeper and hack on OledGrph.c?

Thanks!

Craig

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Once again, I answered my own question (hey I'm a SW newbie).  There's a command in the driver called OLED_ClearBuffer() that does just what you'd think it does.  It was erasing each shape after I drew it.  Sorry to bug you all.   

Share this post


Link to post
Share on other sites
  • 0

Hi @CraigA,

Presuming you are using the IP core on our Digilent GitHub (link), you can add an additional OLED_DrawRect function that starts from a new position (set by the OLED_MoveTo function); you'll also likely want to not continually call the DemoInitialize function that is in the main.c since that will reset the memory buffer present in the OLED. Otherwise, I would not call the OLED_ClearBuffer function until you are ready to clear the display and not call the OLED_Update function until you have called everything that you want to appear on the screen at that time (unless you want to show one rectangle, then another rectangle next to it, then you would want to call the OLED_Update function inbetween the two OLED_DrawRect functions).

Let me know if you have any questions about this.

Thanks,
JColvin

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now