Cronus GPC Documentation
Cronus CommunityGPC LibraryGPC Guide
  • Welcome
  • Introduction
    • GPC Explained
    • What's New with Zen?
  • Basic Syntax
  • A Simple Tutorial
  • Style Guide
  • GPC Structure
  • Basic GPC Structure
  • Definitions
  • Data Section
  • Remapping
  • Variables
  • Init Section
  • Main Section
  • Combo Section
  • User Created Functions
  • GPC Programming Basics
  • Constants
    • Zen
      • OLED
      • ASCII Constants
      • PIO
    • Keyboard
      • Keyboard
    • Controller
      • Polar
      • LED
      • Rumble
      • PS3
      • PS4
      • XBox 360
      • Xbox One
      • Nintendo WII
      • Nintendo Switch
    • Racing Wheel
      • G29
      • G27
      • G25
      • DF
      • DF GT
      • DF Pro
    • Trace
    • Memory
    • Misc
  • Flow Control
  • Persistent Memory
  • Operator Types
  • Identifiers
  • Functions & Commands
    • Internal Functions
      • Bit Functions
      • Combo Functions
      • Math Functions
      • Device Functions
      • OLED Display Functions
    • Console Functions
      • Core Console Functions
    • Controller Functions
      • Core Controller Functions
      • Rumble Functions
      • LED Functions
    • Keyboard Functions
      • Core Keyboard Functions
  • GPC Examples
    • #1
Powered by GitBook
On this page
  • pixel_oled
  • line_oled
  • rect_oled
  • circle_oled
  • putc_oled
  • puts_oled
  • cls_oled
  • printf

Was this helpful?

  1. Functions & Commands
  2. Internal Functions

OLED Display Functions

PreviousDevice FunctionsNextConsole Functions

Last updated 3 years ago

Was this helpful?

The functions below allow you to control the output display on the Zen. These are specific to the Zen and do not work in the CronusMAX Plus.

Function

Description

Zen

Plus

Draws a pixel on the OLED display

✔️

❌

Draws a line on the OLED display

✔️

❌

Draws a rectangle on the OLED display

✔️

❌

Draws a circle on the OLED display

✔️

❌

Puts a character into the string buffer for puts_oled

✔️

❌

Draws the characters supplied using putc_oled on the OLED display

✔️

❌

Sets the entire OLED display to a single color

✔️

❌

Draws a string on the OLED display

✔️

❌

pixel_oled

Draws a pixel on the OLED display

pixel_oled(x, y, color);

Syntax

pixel_oled( <x> , <y> , <color> );

Parameters

<x> : The X coordinate of the pixel <y> : The Y coordinate of the pixel <color> : The color flag to set the pixel to 0 means Black and 1 means White

Nothing

line_oled

Draws a line of pixels

line_oled(x, y, tox, toy, thickness, color);

line_oled( <x> , <y> , <tox> , <toy> , <thickness> , <color> );

<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

Nothing

rect_oled

Draws a rectangle on the OLED screen of the Cronus Zen

rect_oled(x, y, width, height, fill, color);

rect_oled( <x> , <y>, <width>, <height>, <fill>, <color> );

<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

Nothing

circle_oled

Draws a circle on the Cronus Zen OLED screen.

circle_oled(x, y, radius, fill, color);

circle_oled( <x> , <y>, <radius>, <fill>, <color> );

<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

Nothing

putc_oled

Puts a character into the string buffer for puts_oled

putc_oled(position, ascii);

putc_oled( <position> , <ascii> );

Nothing

puts_oled

Draws the characters supplied using putc_oled on the OLED display

puts_oled(x, y, font, length, color);

puts_oled( <x> , <y> , <font> , <length> , <color> );

Nothing

cls_oled

Sets the entire OLED display to a single color

cls_oled(color);

cls_oled( <color> );

<color> : any defined variable.

Nothing

printf

Draws a string on the OLED display

printf(x, y, font, color, stringaddr);

printf( <x> , <y> , <font> , <color> , <stringaddr> );

Nothing

Returns

Syntax

Parameters

Returns

Syntax

Parameters

Returns

Syntax

Parameters

Returns

Syntax

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

Returns

Syntax

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 <length> <color> : The color flag to set the pixels to 0 means Black and 1 means White

Returns

Syntax

Parameters

Returns

Syntax

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 <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

🔴
⚪
🔵
🔴
⚪
🔵
🔴
⚪
🔵
🔴
⚪
🔵
🔴
⚪
🔵
🔴
⚪
🔵
🔴
⚪
🔵
🔴
⚪
🔵
here
pixel_oled
line_oled
rect_oled
circle_oled
putc_oled
puts_oled
cls_oled
printf
here
here