---
title: OLED Display Functions
slug: gpc/gpc-scripting-oled-display-functions
description: Here are the OLED Display Functions.
icon: ◽
docTags: 
createdAt: 2021-12-08T18:02:02.000Z
---

The functions below allow you to control the output display on the Zen. These are specific only to the Cronus Zen.

| Function     | Description                                                         |
| ------------ | ------------------------------------------------------------------- |
| pixel\_oled  | Draws a pixel on the OLED display.                                  |
| line\_oled   | Draws a line on the OLED display.                                   |
| rect\_oled   | Draws a rectangle on the OLED display.                              |
| circle\_oled | Draws a circle on the OLED display.                                 |
| putc\_oled   | Puts a character into the string buffer for puts\_oled.             |
| puts\_oled   | Draws the characters supplied using putc\_oled on the OLED display. |
| cls\_oled    | Sets the entire OLED display to a single color.                     |
| print        | Draws a string on the OLED display.                                 |

# pixel\_oled

`pixel_oled` draws a pixel on the OLED display

:::CodeblockTabs
GPC

```apex
pixel_oled(x, y, color);
```
:::

🔴 **Syntax**

pixel\_oled(  ,  ,  );

⚪ **Parameters**

&#x20;: The X coordinate of the pixel
&#x20;: The Y coordinate of the pixel
&#x20;: The color flag to set the pixel to 0 means Black and 1 means White

🔵 **Returns**

Nothing

# line\_oled

`line_oled` draws a line of pixels

:::CodeblockTabs
GPC

```apex
line_oled(x, y, tox, toy, thickness, color);
```
:::

🔴 **Syntax**

line\_oled( \<x> , \<y> , \<tox> , \<toy> , \<thickness> , \<color> );

⚪ **Parameters**

\<x> : The starting X coordinate
\<y> : The starting Y coordinate
\<tox> : The ending X coordinate
\<toy> : The ending Y coordinate
\<thickness>: The thickness of the line
\<color>: The color flag to set the pixels to 0 means Black and 1 means White

🔵 **Returns**

Nothing

# rect\_oled

`rect_oled` draws a rectangle on the OLED screen of the Cronus Zen

:::CodeblockTabs
GPC

```apex
rect_oled(x, y, width, height, fill, color);
```
:::

🔴&#x20;**Syntax**

**&#xD;**&#x72;ect\_oled( \<x> , \<y>, \<width>, \<height>, \<fill>, \<color> );

⚪&#x20;**Parameters**

\<x> : The X coordinate of the upper left corner of the rectangle
\<y> : The Y coordinate of the upper left corner of the rectangle
\<width> : The width of the rectangle to draw
\<height> : The height of the rectangle to draw
\<fill> : A flag saying if the rectangle should be filled or just outlined (1 means fill it, 0 means only draw the outline)
\<color> : The color flag to set the pixels to 0 means Black and 1 means White

🔵&#x20;**Returns**

Nothing

# circle\_oled

`circle_oled` draws a circle on the Cronus Zen OLED screen.

:::CodeblockTabs
GPC

```apex
circle_oled(x, y, radius, fill, color);
```
:::

🔴 **Syntax**

circle\_oled( \<x> , \<y>, \<radius>, \<fill>, \<color> );

⚪ **Parameters**

\<x> : The X coordinate of the center of the circle?
\<y> : The Y coordinate of the center of the circle?
\<radius> : The radius of the circle to draw (the distance from the center point to the outer edge)
\<fill> : A flag saying if the rectangle should be filled or just outlined (1 means fill it, 0 means only draw the outline)
\<color> : The color flag to set the pixels to 0 means Black and 1 means White

🔵 **Returns**

Nothing

# putc\_oled

`putc_oled` puts a character into the string buffer for puts\_oled

:::CodeblockTabs
GPC

```apex
putc_oled(position, ascii);
```
:::

🔴 **Syntax**

putc\_oled( \<position> , \<ascii> );

⚪ **Parameters**

\<position> : The 1 based index where to put the character in the buffer
\<ascii> : The ASCII code value to put into the buffer, see table of supported characters/constants here

🔵 **Returns**

Nothing

# puts\_oled

`puts_oled` draws the characters supplied using putc\_oled on the OLED display

:::CodeblockTabs
GPC

```apex
puts_oled(x, y, font, length, color);
```
:::

🔴 **Syntax**

**&#xD;**&#x70;uts\_oled( \<x> , \<y> , \<font> , \<length> , \<color> );

⚪&#x20;**Parameters**

**&#xD;**\<x> : The X coordinate of the upper left corner of where the text will be drawn
\<y> : The Y coordinate of the upper left corner of where the text will be drawn
\<font> : The font constant to use when drawing the text see table of supported fonts&#x20;
\<length>
\<color> : The color flag to set the pixels to 0 means Black and 1 means White

🔵&#x20;**Returns**

**&#xD;**&#x4E;othing

# cls\_oled

`cls_oled` sets the entire OLED display to a single color

:::CodeblockTabs
GPC

```apex
cls_oled(color);
```
:::

🔴&#x20;**Syntax**

cls\_oled( \<color> );

⚪&#x20;**Parameters**

\<color> : any defined variable.

🔵&#x20;**Returns**

Nothing

# print

`print` draws a string on the OLED display

:::CodeblockTabs
GPC

```apex
print(x, y, font, color, stringaddr);
```
:::

🔴 **Syntax**

print( \<x> , \<y> , \<font> , \<color> , \<stringaddr> );

⚪ **Parameters**

\<x> : The X coordinate of the upper left corner of where the text will be drawn
\<y> : The Y coordinate of the upper left corner of where the text will be drawn
\<font> : The font constant to use when drawing the text see table of supported fonts here
\<color> : The color flag to set the pixels to 0 means Black and 1 means White
\<stringaddr> : The offset in the data section where the 0 terminated string is located, usually used with the string constant type

🔵 **Returns**

Nothing

