English
Language : 

LCD-14048 Datasheet, PDF (10/33 Pages) SparkFun Electronics – TeensyView Hookup Guide
oled.begin(); // Initialize the OLED
oled.clear(ALL); // Clear the display's internal memory
oled.display(); // Display what's in the buffer (splashscre
en)
delay(1000);
// Delay 1000 ms
oled.clear(PAGE); // Clear the buffer.
}
void loop()
{
oled.clear(PAGE); // Clear the page
oled.rect(5, 5, 20, 20); // Draw a rectangle
oled.rectFill(35, 16, 23, 11); // Draw a filled rectangle
oled.circle(22, 20, 7); // Draw the circle:
oled.pixel(40, 7, WHITE, NORM); // Draw a white pixel
oled.pixel(48, 21, BLACK, NORM); // Draw a black pixel (on
the above rectange)
oled.setFontType(1); // Set font to type 1
oled.setCursor(73, 17); // move cursor
oled.print("world!"); // Write a byte out as a character
oled.setFontType(0); // Set font to type 0
oled.setCursor(67, 12); // move cursor
oled.print("Hello"); // Write a byte out as a character
oled.display(); // Send the PAGE to the OLED memory
delay(200);
}
In the above example, the standard pins are used for factory hardware. The
“begin” function clears the OLED to our logo, then displays the memory
contents.
TeensyView Class Reference
Below, you’ll find a complete list of available TeensyView classes that can
be called in your code.
Initialization
• void begin(void) — Initialize TeensyView Library.Setup I/O pins
for SPI port, then send initialization commands to the SSD1306
controller inside the OLED.
• void end (void) — Power off the OLED display. Reset display
control signals and prepare the SSD1306 controller for power off,
then power off the 3.3V regulator.
Display Actions, Settings and Orientation
• void display(void) — Transfer display memory. Bulk move the
screen buffer to the SSD1306 controller’s memory so that
images/graphics drawn on the screen buffer will be displayed on the
OLED.
• void clear(* uint8_t mode) — Clear screen buffer or SSD1306’s
memory. To clear GDRAM inside the LCD controller, pass in the
variable mode = ALL and to clear screen page buffer pass in the
variable mode = PAGE.
Page 10 of 33