Advertisement
pleasedontcode

SSD1306 Setup rev_01

May 20th, 2024
640
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 NOT compiled for: ESP32 DevKit V1
  14.     - Source Code created on: 2024-05-20 19:15:15
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* lc meter on lm339 comapartor */
  21. /****** END SYSTEM REQUIREMENTS *****/
  22.  
  23. /****** DEFINITION OF LIBRARIES *****/
  24. #include <Wire.h>
  25. #include <Adafruit_SSD1306.h>
  26. #include <U8g2_for_Adafruit_GFX.h>
  27.  
  28. /****** FUNCTION PROTOTYPES *****/
  29. void setup(void);
  30. void loop(void);
  31.  
  32. /***** DEFINITION OF I2C PINS *****/
  33. const uint8_t oled_SSD1306OledDisplay_I2C_PIN_SDA_D21 = 21;
  34. const uint8_t oled_SSD1306OledDisplay_I2C_PIN_SCL_D22 = 22;
  35. const uint8_t oled_SSD1306OledDisplay_I2C_SLAVE_ADDRESS = 60;
  36.  
  37. /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
  38. Adafruit_SSD1306 display(oled_SSD1306OledDisplay_I2C_PIN_SCL_D22, oled_SSD1306OledDisplay_I2C_PIN_SDA_D21);
  39.  
  40. void setup(void)
  41. {
  42.     // Initialize the SSD1306 display
  43.     display.begin(SSD1306_SWITCHCAPVCC, oled_SSD1306OledDisplay_I2C_SLAVE_ADDRESS);
  44.     display.display();
  45.     delay(2000);
  46.     display.clearDisplay();
  47. }
  48.  
  49. void loop(void)
  50. {
  51.     // Main code to run repeatedly
  52. }
  53.  
  54. /* lc meter on lm339 comapartor */
  55. /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement