Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Bibliotecas //
- #include <Wire.h>
- #include <Adafruit_GFX.h>
- #include <Adafruit_SSD1306.h>
- #include <Fonts/FreeMonoOblique18pt7b.h>
- //Tamanho da Tela
- #define SCREEN_WIDTH 128
- #define SCREEN_HEIGHT 64
- // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
- Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
- void setup() {
- Serial.begin(115200);
- if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
- Serial.println(F("SSD1306 allocation failed"));
- for (;;);
- }
- delay(2000);
- display.setFont(&FreeMonoOblique18pt7b);
- display.clearDisplay();
- display.setTextSize(1);
- display.setTextColor(WHITE);
- display.setCursor(1, 20);
- // Display static text
- display.println("amogus");
- display.display();
- }
- void loop() {
- // Scroll in various directions, pausing in-between:
- display.startscrollright(0x00, 0x0F);
- delay(2000);
- display.invertDisplay(true);
- delay(2000);
- display.invertDisplay(false);
- delay(2000);
- }
Advertisement
Add Comment
Please, Sign In to add comment