]> jspc29.x-matter.uni-frankfurt.de Git - avr.git/commitdiff
fix display bug below 0°
authorJan Michel <j.michel@gsi.de>
Fri, 12 Jul 2019 09:37:51 +0000 (11:37 +0200)
committerJan Michel <j.michel@gsi.de>
Fri, 12 Jul 2019 09:37:51 +0000 (11:37 +0200)
atmega32u4/cooler/cooler.c

index ae8ff3cadbde931fb7f749d91066ba7e74806a92..d2163a727bfa9e295545f1da156ffbcd1d86e45e 100644 (file)
@@ -57,9 +57,10 @@ void draw(void) {
       else    lcd_use_foreground(colors[0]);
 
       uint16_t y = values[i][p];
+      y = y + 20*16; //plus 20K to have positive values at minimum
       y = y*3;
       y >>= 5;
-      y = 190-y;
+      y = 220-y; //190 + 30 for correction
       if(y<MAXY && y>MINY-1) {
         lcd_set_pixel_col_xy(c+1,y,background);
         lcd_set_pixel_col_xy(c+1,y+1,background);
@@ -530,4 +531,4 @@ __attribute__((naked)) int main(void) {
       }
     }  
   }   
-    
\ No newline at end of file
+