Esempio n. 1
0
void setup() {                
  
  // initialize and set the contrast to 0x18
  glcd.begin(0x18);

  // show splashscreen
  glcd.display(); 
  delay(500);
  glcd.clear(); 
  
  // turn on backlight
  pinMode(BACKLIGHT_LED, OUTPUT);
  digitalWrite(BACKLIGHT_LED, HIGH);

  // For I2C
  Wire.begin();

  // For console debugging
  Serial.begin(9600);

  // Configure the ladder
  a5b.setLadder(3.3, ladder);
  a5b.removeState(17);
  a5b.removeState(18);
  a5b.setTiming(20, 3);

  for (int i=0; i<5; i++) {
    buttonsX[5-i-1] = startX+i*squareSpacing;
  }

  counter = 0;
  prevtime = millis();
}
Esempio n. 2
0
void LCD_ST7565::updateCounter(uint32_t time)
{
  glcd.clear();
  glcd.drawstring(0,0,"Operator:");
  glcd.drawstring(0,1,"Lord Clancy");
  formatHalfTime(time, 2, 0);
  formatFullTime(time, 2, 61); // 128 pixels - (11 chars * 6 pixels) = 62 - 1
  
  glcd.drawstring(0,4,"Maintain in:");
  formatHourTime(time, 4, 79); // 128 pixels - (8 chars * 6 pixels) = 80 - 1
  
  glcd.drawstring(0,6,"Machine Time:");
  formatFullTime(time, 7, 0);

  glcd.display();
}
Esempio n. 3
0
void loop()                     
{
  //glcd.clear();

  a5b.update();

  byte bm = 1;
  for ( int i=0; i<5; i++ ) {
    int state = a5b.getState(bm);
    if ( state ) {
      glcd.fillrect(buttonsX[i], startY, squareSize, squareSize, 1);
    }
    else {
      glcd.fillrect(buttonsX[i]+1, startY+1, squareSize-2, squareSize-2, 0);
      glcd.drawrect(buttonsX[i], startY, squareSize, squareSize, 1);
    }
    bm = bm << 1;
  }
  

  unsigned long newtime = millis();
  int elapsed = newtime-prevtime;
  String str(elapsed, DEC);
  str.toCharArray(elapsedStr, 8);
  prevtime = newtime;

  glcd.drawstring(8, 4, blank);
  glcd.drawstring(8, 4, elapsedStr);

  glcd.display();

  counter++;

  delay(WAIT_LOOP);

}
Esempio n. 4
0
void LCD_ST7565::start(void)
{
  glcd.clear();
  glcd.drawstring(0,0,"Hello World");
  glcd.display();
}
Esempio n. 5
0
void LCD_ST7565::init(void)
{
  glcd.begin(0x18);
  glcd.display(); // show splashscreen
}