Advertisement
Guest User

nokia5110lcd

a guest
Feb 10th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include "U8glib.h"
  2.  
  3. U8GLIB_PCD8544 u8g(8, 9, 11, 10, 12); // SPI Com: SCK/CLK = 13, MOSI/DIN = 11, CS/CE = 10, A0/DC = 9, Reset/RST = 8
  4.  
  5. int sensorPin = A0;
  6. int sensorValue = 0;
  7.  
  8. void setup() {
  9. }
  10.  
  11. void loop() {
  12. // picture loop
  13. u8g.firstPage();
  14. do {
  15. u8g.setContrast(128);
  16. u8g.setFont(u8g_font_fub35n);
  17. u8g.setPrintPos(0, 44);
  18. u8g.print(sensorValue);
  19. } while( u8g.nextPage() );
  20.  
  21. sensorValue = analogRead(sensorPin);
  22. delay(1000);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement