/* * Function:makeHTmeasurements(void) * -------------------- * Function used to run the sequence of measurements: * 1.Read RH * 2.Calculate Humidity value * 3.Get last temperature measurement after RH measurement was done * 4.Calculate temperature value * 5.Update the display with new values. */ void makeHTmeasurements(void) { measureRH(); humidityValue = calculateHumidity(humidityCode); getLastTemp(); temperatureValue = calculateTemperature(temperatureCode); char str[10]; char humm[10]; sprintf(str, "%d", temperatureValue); oled_prints(30, 6, str); sprintf(humm, "%d", humidityValue); oled_prints(45, 8, humm); oled_render(); UART1PutStr(str); }
int main(void) { sys_init(); oled_init(); oled_clearDisplay(); oled_prints(35, 4, "Hello world"); // print on center of the screen oled_render(); while(1) { LED ^= 1; __delay_ms(100); } return (0); }