Guest User

Untitled

a guest
Jun 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <Arduino.h>
  2. #include <U8g2lib.h>
  3.  
  4. #ifdef U8X8_HAVE_HW_SPI
  5. #include <SPI.h>
  6. #endif
  7. #ifdef U8X8_HAVE_HW_I2C
  8. #include <Wire.h>
  9. #endif
  10.  
  11.  
  12. U8G2_ST7920_128X64_1_SW_SPI u8g2(U8G2_R0, /* clock=*/ 14, /* data=*/ 13, /* CS=*/ 12, /* reset=*/ 2);
  13.  
  14. void setup(void) {
  15.  
  16. u8g2.begin();
  17. }
  18.  
  19. void loop(void) {
  20. u8g2.firstPage();
  21. do {
  22. u8g2.setFont(u8g2_font_ncenB10_tr);
  23. u8g2.drawStr(0, 24, String(millis()).c_str());
  24. } while ( u8g2.nextPage() );
  25. delay(1000);
  26. }
Add Comment
Please, Sign In to add comment