You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
void munching(unsigned char t) {
for (int i = 0; i < WIDTH/8; i++) {
for (int j = 0; j < HEIGHT; j++) {
const unsigned int idx = j*(WIDTH/8) + i;
unsigned char c = 0x0;
for (int k = 0; k < 8; k++) {
const unsigned int y = j;
const unsigned int x = (i*8)+k;
if ((x^y) < t) {
c |= (1<<(7-k));
}
}
image[idx]=c;
}
}
}
void setup() {
pinMode(16,OUTPUT);
digitalWrite(16, LOW); // set GPIO16 low to reset OLED
delay(50);
digitalWrite(16, HIGH); // while OLED is running, must set GPIO16 in high
void loop() {
munching(t);
t++;
if (t > 128) t = 0;
display.clear();
// display.drawXbm(0,0,128,64,(const char*)image);
// If you receive an error during compilation :
// My_SSD1306_On_TTGO_Oled:59:48: error: invalid conversion from 'const char*' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive]
// display.drawXbm(0,0,128,64,(const char*)image);
// uncomment this line herafter
display.drawXbm(0,0,128,64,(const uint8_t*)image);
// Swap over to get an interleaved munching squares :)
//display.drawFastImage(0,0,128,64,(const char*)image);
display.display();
delay(2);
}`
Hi,
I am trying out this simple helloworld code:
https://techtutorialsx.com/2017/12/02/esp32-arduino-interacting-with-a-ssd1306-oled-display/
Would it be possible to add such example to your repo?
Best
The text was updated successfully, but these errors were encountered: