Advertisement
pleasedontcode

hamza rev_01

Oct 20th, 2023
94
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: hamza
  13.     - Source Code compiled for: Arduino Uno
  14.     - Source Code created on: 2023-10-20 06:22:07
  15.     - Source Code generated by: Hamza
  16.  
  17. ********* Pleasedontcode.com **********/
  18. /****** DEFINITION OF LIBRARIES *****/
  19. #include <Arduino.h>
  20. #include <Wire.h>
  21. #include <Adafruit_SSD1306.h>
  22.  
  23. /****** SYSTEM REQUIREMENT 1 *****/
  24. /* m;ggxz  ldg */
  25.  
  26. /****** FUNCTION PROTOTYPES *****/
  27. void setup(void);
  28. void loop(void);
  29.  
  30. /***** DEFINITION OF I2C PINS *****/
  31. const uint8_t OLED_DISPLAY_SDA_PIN = A4;
  32. const uint8_t OLED_DISPLAY_SCL_PIN = A5;
  33. const uint8_t OLED_DISPLAY_SLAVE_ADDRESS = 0x3C;
  34.  
  35. Adafruit_SSD1306 display(128, 64, &Wire, OLED_DISPLAY_SDA_PIN, OLED_DISPLAY_SCL_PIN);
  36.  
  37. void setup(void)
  38. {
  39.   // Initialize I2C communication
  40.   Wire.begin();
  41.  
  42.   // Initialize OLED display
  43.   display.begin(SSD1306_SWITCHCAPVCC, OLED_DISPLAY_SLAVE_ADDRESS);
  44.   display.clearDisplay();
  45.   display.setTextColor(WHITE);
  46.   display.setTextSize(1);
  47.   display.setCursor(0, 0);
  48.   display.println("Hello, world!");
  49.   display.display();
  50. }
  51.  
  52. void loop(void)
  53. {
  54.   // put your main code here, to run repeatedly:
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement