0% found this document useful (0 votes)
21 views1 page

Final Arduino

This code is displaying a series of 22 bitmap images on an OLED display in a loop. It initializes the OLED display with a width of 128 pixels and height of 64 pixels. In the setup, it clears the display buffer. In the loop, it uses an index variable to draw each bitmap image to the display one by one, waits 1.7 seconds, then clears the display buffer to prepare it for the next image.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views1 page

Final Arduino

This code is displaying a series of 22 bitmap images on an OLED display in a loop. It initializes the OLED display with a width of 128 pixels and height of 64 pixels. In the setup, it clears the display buffer. In the loop, it uses an index variable to draw each bitmap image to the display one by one, waits 1.7 seconds, then clears the display buffer to prepare it for the next image.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include <SPI.

h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#include "image.h" // carrega imagens 128 X 64

#define SCREEN_WIDTH 128 // OLED display width, in pixels


#define SCREEN_HEIGHT 64 // OLED display height, in pixels

// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)


#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

void setup() {
// initialize with the I2C addr 0x3C
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

// Clear the buffer.


display.clearDisplay();
}

void loop() {
for (byte i=1;i<23;i++) {
// Display bitmap
if (i==1) display.drawBitmap(0, 0, image1, 128, 64, WHITE);
if (i==2) display.drawBitmap(0, 0, image2, 128, 64, WHITE);
if (i==3) display.drawBitmap(0, 0, image3, 128, 64, WHITE);
if (i==4) display.drawBitmap(0, 0, image4, 128, 64, WHITE);
if (i==5) display.drawBitmap(0, 0, image5, 128, 64, WHITE);
if (i==6) display.drawBitmap(0, 0, image6, 128, 64, WHITE);
if (i==7) display.drawBitmap(0, 0, image7, 128, 64, WHITE);
if (i==8) display.drawBitmap(0, 0, image8, 128, 64, WHITE);
if (i==9) display.drawBitmap(0, 0, image9, 128, 64, WHITE);
if (i==10) display.drawBitmap(0, 0, image10, 128, 64, WHITE);
if (i==11) display.drawBitmap(0, 0, image11, 128, 64, WHITE);
if (i==12) display.drawBitmap(0, 0, image12, 128, 64, WHITE);
if (i==13) display.drawBitmap(0, 0, image13, 128, 64, WHITE);
if (i==14) display.drawBitmap(0, 0, image14, 128, 64, WHITE);
if (i==15) display.drawBitmap(0, 0, image15, 128, 64, WHITE);
if (i==16) display.drawBitmap(0, 0, image16, 128, 64, WHITE);
if (i==17) display.drawBitmap(0, 0, image17, 128, 64, WHITE);
if (i==18) display.drawBitmap(0, 0, image18, 128, 64, WHITE);
if (i==19) display.drawBitmap(0, 0, image19, 128, 64, WHITE);
if (i==20) display.drawBitmap(0, 0, image20, 128, 64, WHITE);
if (i==21) display.drawBitmap(0, 0, image21, 128, 64, WHITE);
if (i==22) display.drawBitmap(0, 0, image22, 128, 64, WHITE);
display.display();
delay(1700);
// Clear the buffer.
display.clearDisplay();
}
}

You might also like