Created
June 26, 2022 00:57
-
-
Save crides/1146c97c3fc4d75d848013d8c8c35044 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <Wire.h> | |
#include <Adafruit_GFX.h> | |
#include <Adafruit_SSD1306.h> | |
Adafruit_SSD1306 display = Adafruit_SSD1306(128, 32, &Wire); | |
void setup() { | |
Wire.setPins(13, 16); | |
Serial.begin(115200); | |
Serial.println("OLED FeatherWing test"); | |
// SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally | |
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // Address 0x3C for 128x32 | |
Serial.println("OLED begun"); | |
// Show image buffer on the display hardware. | |
// Since the buffer is intialized with an Adafruit splashscreen | |
// internally, this will display the splashscreen. | |
display.display(); | |
delay(1000); | |
// Clear the buffer. | |
display.clearDisplay(); | |
display.display(); | |
// text display tests | |
display.setTextSize(1); | |
display.setTextColor(SSD1306_WHITE); | |
display.setCursor(0,0); | |
display.print("Connecting to SSID\n'adafruit':"); | |
display.print("connected!"); | |
display.println("IP: 10.0.1.23"); | |
display.println("Sending val #0"); | |
display.setCursor(0,0); | |
display.display(); // actually display all of the above | |
} | |
void loop() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment