Rounded rectangle

The rectangle functions take five parameters. The first two are the X/Y coordinates of the upper left corner of the rectangle. The next two parameters are the X/Y coordinates of the lower right-hand corner of the rectangle, and the last parameter is the color to draw the rectangle and the color to fill the rectangle for the fillRect() function.

The next two examples show how we can draw rounded rectangles with the Adafruit library:

display.drawRoundRect(15,15,30,15,4,BLACK);

Get Mastering Arduino now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.