Example #1
0
///////////////////
// DEBUG code only
void PrintScreenToSerial() {
  for (unsigned int y = 0; y < Lcd.height(); y++) {
    for (unsigned int x = 0; x < Lcd.width(); x++) {
      Serial.print(Lcd.getPixel(x,y) ? "#":" ");
    }
    Serial.println();
  }
}
Example #2
0
void InitLcd() {
  // Set up the LCD, display logo
  Lcd.begin();
  Lcd.setContrast(LCD_CONTRAST);
  Lcd.clearDisplay();
  Lcd.drawXBitmap(0, 0, LOGO_NAME, LOGO_WIDTH, LOGO_HEIGHT, BLACK);
  Lcd.display(); // show splashscreen
  delay(1000);
}
Example #3
0
///////////////////
// Call with -100 .. +100
// e.g:
//#define VMAXCLIMB 4.0
//DrawVarioBar(Vario.toFloat()*100/VMAXCLIMB;)
void DrawVarioBar(int percent) {
  if (percent > 100) percent = 100;
  if (percent < -100) percent = -100;
                
  Lcd.drawRect(VX, VY, VW, VH, BLACK);
  Lcd.drawLine(VBARX, VBARY, VBARX2, VBARY, BLACK);
  
  int filledH = VH*percent/200;
  Lcd.fillRect(VX, VBARY, VW, -filledH, BLACK);
}
Example #4
0
void DrawSpeedBar(int percent) {
  if (percent > 100) percent = 100;
  if (percent < -100) percent = -100;
                
  Lcd.drawRect(SX, SY, SW, SH, BLACK);
  Lcd.drawLine(SBARX, SBARY, SBARX, SBARY2, BLACK);
  
  int filledW = SW*percent/200;
  if (filledW > 0) {
    Lcd.fillRect(SBARX, SY, filledW, SH, BLACK);
  }
  else {
    Lcd.fillRect(SBARX+filledW, SY, -filledW, SH, BLACK);
  }
}
Example #5
0
void initDisplay() {
    display.begin();
    display.setRotation(2);
    display.setContrast(5);
    display.clearDisplay();
    display.setCursor(0, 0);
    display.println("Measuring...");
    display.display();
}
Example #6
0
void displayTemps() {
    uint8_t a;

    if (!ReadTemp.MeasureStatus()) {
        display.clearDisplay();
        display.setCursor(0, 0);

        for (a = 0; a < ReadTemp.GetSensorsCount(); a++) {
            if (ReadTemp.IsValidTemperature(a)) {
                display.printf("T%d: %.2f %cC\n", a + 1, ReadTemp.GetCelsius(a), (char) 0x7f);
            }
        }
        display.display();
    }
    else {
        display.println("Measure err.");
        Serial.println("Measure err.");
    }


}
Example #7
0
void FlipGlcd::glcdDisp(int a)
{
  display.setCursor(0,15);  
  display.print("Temp: ");
  display.setCursor(40,15);
  display.print(a);
  display.setCursor(60,15);
  display.print("F");  
 
  display.display();
}
Example #8
0
void DrawGui(int Vario, byte Speed, int HeightGps, int HeightBaro, byte Satellites, const String& Status, float VRaw, char Recording) {
  Lcd.clearDisplay();

  /////////////////////////////  
  Lcd.setTextColor(BLACK);
  Lcd.setFont(&FreeSansBold9pt7b);
  Lcd.setTextSize(1);

  Lcd.setCursor(POS_HBARO);
  Lcd.print(HeightBaro);
  Lcd.setCursor(POS_VARIO);
  Lcd.print(Vario < 0 ? "-" : "+"); 
  Lcd.print(abs(Vario)/10); Lcd.print('.'); Lcd.print(abs(Vario)%10);
  Lcd.setCursor(POS_SPEED);
  Lcd.print(Speed); 
  
  /////////////////////////////  
  //Lcd.setTextColor(BLACK);
  Lcd.setFont();
  Lcd.setTextSize(1);

  Lcd.setCursor(POS_HGPS);
  Lcd.print(HeightGps);

  Lcd.setCursor(POS_TIME);
  unsigned long secsSinceStart = millis() / T_DIVSEC;
  if (secsSinceStart < T_10MIN) {
    Lcd.print(secsSinceStart/T_MIN); Lcd.print('.');
    unsigned long sec = secsSinceStart%T_MIN;
    if (sec < 10) Lcd.print('0');
    Lcd.print(sec);
  }
  else {
    unsigned long minSinceStart = secsSinceStart/T_MIN;
    Lcd.print(minSinceStart/60); Lcd.print(':');
    unsigned long min = minSinceStart%60;
    if (min < 10) Lcd.print('0');
    Lcd.print(min);
  }

  if (Status.length()) {
    Lcd.setCursor(POS_STATUS);
    Lcd.print(Status);
  }
  else {
    Lcd.setCursor(POS_KMH);
    Lcd.print("km/h");

    Lcd.setCursor(POS_MS);
    Lcd.print("m/s");
  }


  Lcd.setCursor(POS_VOLT);
  Lcd.print(VRaw);  Lcd.print('V');

  /////////////////////////////  
  Lcd.setTextColor(WHITE, BLACK);

  Lcd.setCursor(POS_SAT);
  if (Satellites < 10) {
    Lcd.print(Satellites);
  }
  else {
    // Many many Satellites visible, but only use one character on display
    Lcd.print('%');
  }
  Lcd.print(Recording);
  
  /////////////////////////////  

  DrawVarioBar(Vario*10/VMAXCLIMB); 
  DrawSpeedBar((Speed-VAVERAGE)*100/VMAXDIFF);

  Lcd.display();
}
Example #9
0
void FlipGlcd::glcdDisp(int a, int b, int c)
{
  display.clearDisplay();
  display.setTextSize(1);
  
  display.setCursor(0,0);
  display.print("Steps: ");
  display.setCursor(40,0);
  display.print(a);
    
  display.setCursor(0,15);  
  display.print("Temp: ");
  display.setCursor(40,15);
  display.print(b);
  display.setCursor(60,15);
  display.print("F");  
    
  display.setCursor(0,30);
  display.print("Heart");
  display.setCursor(0,40);
  display.print("Rate");
  display.setCursor(30,35);
  display.print(":");    
  display.setCursor(40,35);
  display.print(c);  
  display.setCursor(60,35);
  display.print("BPM"); 
    
  display.display();
}
Example #10
0
void FlipGlcd::glcdInit()
{
  display.begin();
 /* static const unsigned char PROGMEM logo16_glcd_bmp[] =
  {
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
    0b11111110, 0b00000000, 0b00000000, 0b00001111, // #######                     ####
    0b11111100, 0b00000000, 0b00000000, 0b00001111, // ######                      ####
    0b11111000, 0b00000000, 0b00000000, 0b00001111, // #####                       ####
    0b11110000, 0b00000000, 0b00000000, 0b00001111, // ####                        ####
    0b11100000, 0b00000000, 0b00000000, 0b00001111, // ###                         ####
    0b11100000, 0b00000000, 0b00000000, 0b00001111, // ###                         ####
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
    0b11111111, 0b10000000, 0b00000000, 0b00001111, // #########                   ####
    0b11111111, 0b00000000, 0b00000000, 0b00001111, // ########                    ####
    0b11111100, 0b00000000, 0b00000000, 0b00001111, // ######                      ####
    0b11111000, 0b00000000, 0b00000000, 0b00001111, // #####                       ####
    0b11111000, 0b00000000, 0b00000000, 0b00001111, // #####                       ####
    0b11110000, 0b00000000, 0b00000000, 0b00001111, // ####                        ####
    0b11110000, 0b00001111, 0b11111111, 0b11111111, // ####       #####################
    0b11100000, 0b00111111, 0b11111111, 0b11111111, // ###       ######################
    0b11100000, 0b01111111, 0b11111111, 0b11111111, // ###      #######################
    0b11100000, 0b01111111, 0b11111111, 0b11111111, // ###      #######################
    0b11100000, 0b01111111, 0b11111111, 0b11111111, // ###      #######################
    0b11100000, 0b01111111, 0b11111111, 0b11111111, // ###      #######################
    0b11100000, 0b01111111, 0b11111111, 0b11111111, // ###      #######################
    0b11100000, 0b01111111, 0b11111111, 0b11111111, // ###      #######################
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
  };
  display.begin();
  // miniature bitmap display
  display.clearDisplay();
  display.drawBitmap(25, 5,  logo16_glcd_bmp, 32, 32, 1);
  display.display();
  display.setCursor(12,40);
  display.print("DREAM IoT");
  display.display();//------------------------------------------------------
  delay(5000);
  display.clearDisplay();
  display.setCursor(0,5);
  display.print("  FLIP WATCH");
  //display.display();
  display.setCursor(0,20);
  display.print("Initilizing...");
  //display.display();//-------------------------------------------------
  for (int i=0; i<80; i++)
  {
    display.setCursor(i,30);
    display.print(".");
    //display.display();
    display.setCursor(i,32);
    display.print(".");
    //display.display();
    display.setCursor(i,34);
    display.print(".");
    display.display();//-----------------------------------------------------
    delay(5);
  }*/
  display.clearDisplay();
}
Example #11
0
void FlipGlcd::glcdDisp(int a, int b)
{
  display.clearDisplay();
  display.setTextSize(1);
  
  display.setCursor(0,0);
  display.print("Steps: ");
  display.setCursor(40,0);
  display.print(a);
    
  display.setCursor(0,15);  
  display.print("Temp: ");
  display.setCursor(40,15);
  display.print(b);
  display.setCursor(60,15);
  display.print("F");  
    
  display.display();
}