Guest User

Untitled

a guest
Mar 11th, 2015
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include "U8glib.h"
  2.  
  3. U8GLIB_DOGM128 u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
  4.  
  5. int BPM=0;
  6.  
  7. void draw(void) {
  8. // graphic commands to redraw the complete screen should be placed here
  9. u8g.setFont(u8g_font_profont29);
  10. u8g.setPrintPos(0, 40);
  11.  
  12. // call procedure from base class, http://arduino.cc/en/Serial/Print
  13. u8g.print("Puls:");
  14. u8g.print(BPM);
  15. }
  16.  
  17. void setup(void) {
  18. u8g.setContrast(55);
  19. }
  20.  
  21. void loop(void) {
  22. // picture loop
  23. u8g.firstPage();
  24. do {
  25. draw();
  26. } while( u8g.nextPage() );
  27.  
  28. // rebuild the picture after some delay
  29. delay(500);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment