Page 52 - Gartenbahn
P. 52

51


               251
               252 /*******Uhr ***********/
               253
               254 void Uhr()
               255 {
               256 if (dew1 < 59)
               257 {
               258 dew1++; // einer Minute
               259 }
               260
               261 else {
               262 dew1=0;
               263
               264 if (hum1<23) //zehner Minute
               265 {
               266 hum1++;
               267 }
               268 else hum1=0;
               269 }
               270
               271 sprintf(logString,"%02d:%02d",hum1,dew1);
               272
               273 OLED1();
               274 }
               275
               276 /**************Display***************/
               277
               278
               279 void DisplayInit(){
               280 for (int i = 0; i < 7; i++) {
               281 /****Loop through each connected displays on the I2C buses***/
               282 tcaselect(i);
               283 u8g2.firstPage();
               284 do {
               285 /****Initialize display****/
               286 u8g2.begin();
               287 } while( u8g2.nextPage() );
               288 }
               289 }
               290
               291 /************* Multiplexer************/
               292
               293 void tcaselect(uint8_t i2c_bus) {
               294 if (i2c_bus > 7) return;
               295 Wire.beginTransmission(MUX_Address);
               296 Wire.write(1 << i2c_bus);
               297 Wire.endTransmission();
               298 }
               299
   47   48   49   50   51   52   53   54   55   56   57