Advertisement
pleasedontcode

"SSD1306 Setup" rev_01

Feb 17th, 2024
78
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: "SSD1306 Setup"
  13.     - Source Code compiled for: ESP32 DevKit V1
  14.     - Source Code created on: 2024-02-17 06:40:19
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* wyswietl na wyswietlaczy encje pobrane z home */
  21.     /* assistant */
  22. /****** END SYSTEM REQUIREMENTS *****/
  23.  
  24. /****** DEFINITION OF LIBRARIES *****/
  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 displey_SSD1306OledDisplay_I2C_PIN_SDA_D21 = 21;
  35. const uint8_t displey_SSD1306OledDisplay_I2C_PIN_SCL_D22 = 22;
  36. const uint8_t displey_SSD1306OledDisplay_I2C_SLAVE_ADDRESS = 60;
  37.  
  38. /****** DEFINITION OF LIBRARY CLASS INSTANCES *****/
  39. Adafruit_SSD1306 display(128, 64, &Wire, displey_SSD1306OledDisplay_I2C_PIN_SDA_D21, displey_SSD1306OledDisplay_I2C_PIN_SCL_D22);
  40. U8G2_FOR_ADAFRUIT_GFX u8g2_for_adafruit_gfx;
  41.  
  42. void setup(void) {
  43.   // Initialize display and U8g2_for_Adafruit_GFX
  44.   display.begin(SSD1306_SWITCHCAPVCC, displey_SSD1306OledDisplay_I2C_SLAVE_ADDRESS);
  45.   u8g2_for_adafruit_gfx.begin(display);
  46.  
  47.   // System Requirement 1: Display entities from home assistant
  48.   // Code to fetch and display entities from home assistant
  49.   // Wyswietl na wyswietlaczy encje pobrane z home assistant
  50.  
  51. }
  52.  
  53. void loop(void) {
  54.   // Loop through system requirements
  55.  
  56.   // System Requirement 1: Display entities from home assistant
  57.   // Code to fetch and display entities from home assistant
  58.   // Wyswietl na wyswietlaczy encje pobrane z home assistant
  59.  
  60.   // System Requirement 2: Add more system requirements here
  61.  
  62.   // Additional code for other system requirements
  63.  
  64.   // Add delay or other logic if needed
  65. }
  66.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement