Advertisement
Guest User

Untitled

a guest
Aug 17th, 2023
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | Haiku | 0 0
  1. #include <iostream>
  2. #include <Adafruit_GFX.h>
  3. #include <Adafruit_SSD1331.h>
  4.  
  5. const int8_t SCL_PIN = 14; //sclk
  6. const int8_t SDA_PIN = 13; //mosi
  7. const int8_t CS_PIN = 25; //cs
  8. const int8_t RES_PIN = 26; //rst
  9. const int8_t DC_PIN = 27; //dc
  10.  
  11. const uint16_t BLACK = 0x0000;
  12. const uint16_t WHITE = 0xFFFF;
  13.  
  14. #define show endWrite
  15. #define clear() fillScreen(BLACK);
  16.  
  17. auto display = Adafruit_SSD1331(
  18.     CS_PIN,
  19.     DC_PIN,
  20.     SDA_PIN,
  21.     SCL_PIN,
  22.     RES_PIN
  23. );
  24.  
  25. void setup()
  26. {
  27.     Serial.begin(115200);
  28.     Serial.println("Display SSD1331 1.32");
  29.     Serial.println("Luton Research 2023");
  30.     display.begin();
  31.     display.clear();
  32. }
  33.  
  34. void loop()
  35. {
  36.     display.setTextColor(WHITE);
  37.     display.setTextSize(2);
  38.     display.setCursor(1, 1);
  39.     display.println("Hello World");
  40.     display.show();
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement