Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1.  
  2.  
  3. #include <SPI.h>
  4. #include <Wire.h>
  5. #include <Adafruit_GFX.h>
  6. #include <Adafruit_SSD1306.h>
  7.  
  8. #define OLED_RESET -1
  9. Adafruit_SSD1306 display(OLED_RESET);
  10.  
  11.  
  12.  
  13.  
  14. #if (SSD1306_LCDHEIGHT != 64)
  15. #error("Height incorrect, please fix Adafruit_SSD1306.h!");
  16. #endif
  17.  
  18.  
  19. void setup() {
  20. Serial.begin(9600);
  21.  
  22. // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  23. display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64)
  24.  
  25. display.clearDisplay();
  26. display.display();
  27.  
  28. display.setRotation(0);
  29. // draw a single pixel
  30. display.drawPixel(10, 10, WHITE);
  31.  
  32. display.display();
  33. delay(1000);
  34. display.clearDisplay();
  35. TWBR=12;
  36.  
  37. cmjets();
  38.  
  39. }
  40.  
  41.  
  42.  
  43.  
  44. void loop() {
  45.  
  46. }
  47.  
  48.  
  49. void cmjets(){
  50. int i;
  51. display.clearDisplay();
  52.  
  53. for(i=0; i<64;i++)
  54. {
  55.  
  56. display.drawLine(120,i,0,31,WHITE);
  57. display.display();
  58. delay(0);
  59. }
  60.  
  61.  
  62.  
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement