Ingo Electronics


  LCD output functions

 


char *LCD_ch = "0000";
char *LCD_channel_value  = "ch0 0.000V";
char *LCD_battery_value  = "Battery 00.000V";



//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
void display_char(char row, char column, unsigned int value){

LCD_ch[0] =  (value/1000)   + 48  ;
LCD_ch[1] =  (value/100)%10 + 48  ;
LCD_ch[2] =  (value/10)%10  + 48  ;
LCD_ch[3] =  (value)%10     + 48  ;

Lcd_Out(row, column, LCD_ch);
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
void display_channel_value(char row, char column,unsigned char ch_num, unsigned int channel_value){

LCD_channel_value[2] =   ch_num +48;
LCD_channel_value[4] =  (channel_value/1000)   + 48  ;
LCD_channel_value[6] =  (channel_value/100)%10 + 48  ;
LCD_channel_value[7] =  (channel_value/10)%10  + 48  ;
LCD_channel_value[8] =  (channel_value)%10     + 48  ;

Lcd_Out(row, column, LCD_channel_value);
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

void display_battery_value(char row, char column,unsigned int battery_value){

LCD_battery_value[8] =  (battery_value/10000)   + 48  ;
LCD_battery_value[9] =  (battery_value/1000)%10 + 48  ;
LCD_battery_value[11] = (battery_value/100)%10  + 48  ;
LCD_battery_value[12] = (battery_value/10)%10   + 48  ;
LCD_battery_value[13] = (battery_value)%10      + 48  ;

Lcd_Out(row, column, LCD_battery_value);
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
void display_balance_status (){

cell_balance_status = ad7280_read_register(cell_balance);

if(cell_balance_status&CB1_ON ==CB1_ON) {Lcd_Out(1, 1,"CB1 ");}
else {Lcd_Out(1, 1,"1off");}
if(cell_balance_status&CB2_ON ==CB2_ON) {Lcd_Out(1, 7,"CB2 ");}
else {Lcd_Out(1, 7,"2off");}
if(cell_balance_status&CB3_ON ==CB3_ON) {Lcd_Out(1,13,"CB3 ");}
else {Lcd_Out(1,13,"3off");}
if(cell_balance_status&CB4_ON ==CB4_ON) {Lcd_Out(1, 1,"CB4 ");}
else {Lcd_Out(2, 1,"4off");}
if(cell_balance_status&CB5_ON ==CB5_ON) {Lcd_Out(1, 7,"CB5 ");}
else {Lcd_Out(2, 7,"5off");}
if(cell_balance_status&CB6_ON ==CB6_ON) {Lcd_Out(1,13,"CB6 ");}
else {Lcd_Out(2,13,"6off");}

}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''