Line 129... |
Line 129... |
129 |
Delay_ms(1000); |
129 |
Delay_ms(1000); |
130 |
|
130 |
|
131 |
lcd_putc("\f"); |
131 |
lcd_putc("\f"); |
132 |
|
132 |
|
133 |
read_adc(ADC_START_ONLY); |
133 |
read_adc(ADC_START_ONLY); |
- |
|
134 |
Delay_ms(100); |
134 |
|
135 |
|
135 |
while(true) |
136 |
while(true) |
136 |
{ |
137 |
{ |
137 |
if(input(OUTPUT_ENABLE)) output_permit=TRUE; |
138 |
if(input(OUTPUT_ENABLE)) output_permit=TRUE; |
138 |
else output_permit=FALSE; |
139 |
else output_permit=FALSE; |
139 |
|
140 |
|
140 |
output_voltage = adc_value * k + q; |
141 |
output_voltage = adc_value * k + q; // compute absalute measured voltage from adc value |
141 |
|
142 |
|
142 |
lcd_gotoxy(1,1); // output voltage out of range |
143 |
lcd_gotoxy(1,1); // output voltage out of range |
143 |
if (output_voltage > 215) printf(lcd_putc,"%3.0f",output_voltage); |
144 |
if (output_voltage > 215) printf(lcd_putc,"%3.0f",output_voltage); |
144 |
else printf(lcd_putc,"---"); |
145 |
else printf(lcd_putc,"---"); |
145 |
|
146 |
|