Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. if (controlboard == 0) {    //need code to powersave display
  2.     ControlError();
  3.   }
  4.   if (controlboard == 1) {
  5.     DisplayIdle();
  6.   }
  7.  
  8. void ControlError() {
  9.   if (error = 0) {
  10.     oled.clearBuffer();
  11.     error = 1;
  12.     idle = 0;
  13.   }
  14.   else {
  15.     oled.setFont(u8g2_font_helvB14_tf);
  16.     oled.setFontPosTop();
  17.     oled.drawStr(25, 1, "Warning:");
  18.     oled.drawStr(31, 25, "Control");
  19.     oled.drawStr(34, 49, "Offline");
  20.     oled.sendBuffer();
  21.   }
  22. }
  23.  
  24. void DisplayIdle() {
  25.   if (idle == 0) {
  26.     oled.clearBuffer();
  27.   }
  28.   else {
  29.     oled.setFontPosTop();
  30.     oled.setFont(u8g2_font_helvB14_tf);
  31.     oled.drawStr(44, 2, "Wifi");
  32.     oled.drawStr(1, 23, "Dishwasher");
  33.     oled.drawStr(42, 45, "v1.0");
  34.     oled.sendBuffer();
  35.     //CheckSignal();
  36.   }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement