#include #include #include /* Needed if linking in external compiler; harmless otherwise */ #include #include "ambient.h" #include "ambientui.h" #include "ambientparam.h" int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) { /* Declare variables */ char dat_file[80]; char log_file[80]; FILE* file_ptr; struct ambient_param_struct ambient_param; int sensor_num; char sensor_name[80]; int i; double meas_value; /* Initialize all files */ strcpy(dat_file, "testdat.ru1"); file_ptr = fopen(dat_file, "w"); if (file_ptr == NULL) return 0; fclose(file_ptr); strcpy(log_file, "testlog.ru1"); file_ptr = fopen(log_file, "w"); if (file_ptr == NULL) return 0; fclose(file_ptr); ambientparam_fill_param_struct(&ambient_param); ambient_init(log_file, dat_file, ambient_param); ambientui_init(25, 50, ambient_param); ambientopui_init(25, 385); SetStdioWindowPosition(430, 50); SetStdioWindowSize(300, 485); //sensor_num = 2; //ambient_get_sensor_name(sensor_num, sensor_name); //printf("Probe %i is %s\n", sensor_num, sensor_name); sensor_num = 2; ambient_get_sensor_name(sensor_num, sensor_name); printf("Probe %i is %s\n", sensor_num, sensor_name); for (i = 0; i < 12; i++) { ambient_get_sensor_output(sensor_num, &meas_value); printf("Measurement %i is %f\n", i, meas_value); } RunUserInterface(); return 0; }