Advertisement
pleasedontcode

OLED Loop rev_01

Dec 8th, 2023
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /********* Pleasedontcode.com **********
  2.  
  3.     Pleasedontcode thanks you for automatic code generation! Enjoy your code!
  4.  
  5.     - Terms and Conditions:
  6.     You have a non-exclusive, revocable, worldwide, royalty-free license
  7.     for personal and commercial use. Attribution is optional; modifications
  8.     are allowed, but you're responsible for code maintenance. We're not
  9.     liable for any loss or damage. For full terms,
  10.     please visit pleasedontcode.com/termsandconditions.
  11.  
  12.     - Project: OLED Loop
  13.     - Source Code compiled for: Arduino Uno
  14.     - Source Code created on: 2023-12-08 14:36:11
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* show pictures */
  21. /****** END SYSTEM REQUIREMENTS *****/
  22.  
  23. /****** DEFINITION OF LIBRARIES *****/
  24. #include <Arduino.h>
  25. #include <Wire.h>
  26. #include <Adafruit_SSD1306.h>
  27. #include <U8g2_for_Adafruit_GFX.h>
  28.  
  29. /****** FUNCTION PROTOTYPES *****/
  30. void setup(void);
  31. void loop(void);
  32.  
  33. /***** DEFINITION OF I2C PINS *****/
  34. const uint8_t tt_SSD1306OledDisplay_I2C_PIN_SDA_A4 = A4;
  35. const uint8_t tt_SSD1306OledDisplay_I2C_PIN_SCL_A5 = A5;
  36. const uint8_t tt_SSD1306OledDisplay_I2C_SLAVE_ADDRESS = 60;
  37.  
  38. /****** DEFINITION OF LIBRARY CLASS INSTANCES*****/
  39. Adafruit_SSD1306 display(tt_SSD1306OledDisplay_I2C_PIN_SDA_A4, tt_SSD1306OledDisplay_I2C_PIN_SCL_A5);
  40. U8G2_FOR_ADAFRUIT_GFX u8g2_for_adafruit_gfx;
  41.  
  42. void setup(void)
  43. {
  44.   // Initialize the display and the U8g2_for_Adafruit_GFX library
  45.   display.begin(SSD1306_SWITCHCAPVCC);
  46.   u8g2_for_adafruit_gfx.begin(display);
  47. }
  48.  
  49. void loop(void)
  50. {
  51.   // System Requirement 1: Show pictures
  52.   display.clearDisplay();
  53.  
  54.   // Insert code to show pictures here
  55.  
  56.   display.display();
  57.   delay(2000);
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement