/Designs/Measuring_instruments/GM_counter/SW/HV_source/main.c
34,6 → 34,13
 
#define MAX_OUTPUT 1000
 
/// Linear interpolation parameters
//
 
#define k 0.333961
#define q 206.952
 
 
unsigned int16 setpoint=43;
unsigned int16 adc_value;
int1 output_permit=FALSE;
122,7 → 129,7
if(input(OUTPUT_ENABLE)) output_permit=TRUE;
else output_permit=FALSE;
 
output_voltage = adc_value * 0.316142 + 223.294;
output_voltage = adc_value * k + q;
 
lcd_gotoxy(1,1);
printf(lcd_putc,"%3.0f",output_voltage);