Made code working for the Waveshare Pico OLED 2.23.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# Arduino OLED Animations
|
||||
Arduino OLED Animations
|
||||
|
||||
Rebuild for use with [PlatformIO](https://platformio.org/) using a [Raspberry Pi Pico](https://www.raspberrypi.com/products/raspberry-pi-pico/) with the [Waveshare Pico OLED 2.23](https://www.waveshare.com/wiki/Pico-OLED-2.23).
|
||||
|
||||
**YOUTUBE VIDEO: https://youtu.be/o3PhC_VJdXo**
|
||||
|
||||
|
||||
+3
-2
@@ -36,7 +36,8 @@
|
||||
#include <U8g2lib.h>
|
||||
#include <Wire.h> // library required for IIC communication
|
||||
|
||||
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // initialization for the used OLED display
|
||||
//U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // initialization for the used OLED display
|
||||
U8G2_SSD1305_128X32_ADAFRUIT_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/10, /* data=*/11, /* cs=*/9, /* dc=*/8, /* reset=*/12);
|
||||
|
||||
// the arrays below are generated from the image2cpp tool, scroll down for the actual code
|
||||
|
||||
@@ -783,7 +784,7 @@ void setup(void) {
|
||||
void loop(void) {
|
||||
|
||||
u8g2.clearBuffer(); // clear the internal memory
|
||||
u8g2.drawXBMP(39, 7, 50, 50, epd_bitmap_allArray[counter]); // draw frame of the animation
|
||||
u8g2.drawXBMP(39, -10, 50, 50, epd_bitmap_allArray[counter]); // draw frame of the animation
|
||||
u8g2.sendBuffer(); // transfer internal memory to the display
|
||||
|
||||
counter = (counter + 1) % 28; // increase the counter, but always go between 0-27
|
||||
|
||||
Reference in New Issue
Block a user