void disp_sysinfo() { printf("Temperature\t\t\t %d(%d)C\n", (TEMP_V25 - getadc(16)) / TEMP_SLOPE / 10 + TEMP_OFFSET, getadc(16)); printf("Internal reference voltage\t %d.%d(%d)V\n", AD2VOL(getadc(17)), AD2VOL_FAC(getadc(17)), getadc(17)); printf("\n"); disp_clkinfo(); }
void *readVoltagesThread(void *args) { struct sensorGrid *readings = (struct sensorGrid *)args; while(1) { float battery = getadc(Configuration.batteryPin), panel = getadc(Configuration.panelPin); //printf ("batt=%f panel=%f \n", battery,panel); if(battery > 5.5) battery = -1; if(panel > 5.5) panel = -1; readings->batteryVoltage = battery * Configuration.batteryMultiplier ; //5.914996 ; //constant for voltage partitor readings->panelVoltage = panel * Configuration.panelMultiplier ;//5.813809 ; //constant for voltage partitor sleep(Configuration.voltageInterval); } }