I am newbie to Arduino and am just learning the code and now using the Sparkfun Micro OLED. I’ve successfully tested the OLED with the demo codes (clock, cube, etc.), but have encountered an issue displaying string text with the text font type 2 and 3. For instance, when uploading the following code to the Arduino Pro Mini 3.3V (SPI pin configuration) I get the corresponding results.
Desired result:
oled.print(“X”);
Summary of Results:
oled.setFontType(0); → Successfully displays smallest X
oled.setFontType(1); → Successfully displays smaller X
oled.setFontType(2); → Nothing displays
oled.setFontType(3); → Nothing displays
I am able to display floating point integers with font type 2 and 3, but strings seem to be an issue.
Any assistance is greatly appreciated.
#include <Wire.h> // Include Wire if you're using I2C
#include <SPI.h> // Include SPI if you're using SPI
#include <SFE_MicroOLED.h> // Include the SFE_MicroOLED library
//////////////////////////
// MicroOLED Definition //
//////////////////////////
#define PIN_RESET 9 // Connect RST to pin 9
#define PIN_DC 8 // Connect DC to pin 8
#define PIN_CS 10 // Connect CS to pin 10
//////////////////////////////////
// MicroOLED Object Declaration //
//////////////////////////////////
MicroOLED oled(PIN_RESET, PIN_DC, PIN_CS); // SPI declaration
//MicroOLED oled(PIN_RESET, DC_JUMPER); // I2C declaration
void setup()
{
oled.begin();
oled.clear(PAGE);
oled.setFontType(3); // Set the text to large (5 columns, 1 row worth of characters)
oled.setCursor(0, 0);
oled.print("X");
oled.display(); // Draw to the screen
}
void loop()
{
}