Commit fa01a342 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Minor chnages in the test application.

parent edbc2fdd
......@@ -19,31 +19,23 @@ int main(int argc, char *argv[])
std::cout << "Buzzer frequency: " << buzzer.freq_hz << " Hz" << std::endl;
std::cout << "Buzzer time on: " << buzzer.time_on_s << " s" << std::endl;
std::cout << "Buzzer time off: " << buzzer.time_off_s << " s" << std::endl;
buzzer.freq_hz=260;
battery.start_buzzer(&buzzer);
battery.get_buzzer_config(&buzzer);
std::cout << "Buzzer frequency: " << buzzer.freq_hz << " Hz" << std::endl;
std::cout << "Buzzer time on: " << buzzer.time_on_s << " s" << std::endl;
std::cout << "Buzzer time off: " << buzzer.time_off_s << " s" << std::endl;
sleep(4);
battery.stop_buzzer();
battery.get_warning_alarm(&time,&time_hist,&buzzer);
std::cout << "Warning alarm time: " << (int)time << " min" << std::endl;
std::cout << "Warning alarm time hysteresis: " << (int)time_hist << " min" << std::endl;
std::cout << "Warning alarm frequency: " << buzzer.freq_hz << " Hz" << std::endl;
std::cout << "Warning alarm time on: " << buzzer.time_on_s << " s" << std::endl;
std::cout << "Warning alarm time off: " << buzzer.time_off_s << " s" << std::endl;
time=180;
battery.set_warning_alarm(time,time_hist,&buzzer);
battery.get_error_alarm(&time,&time_hist,&buzzer);
std::cout << "Error alarm time: " << (int)time << " min" << std::endl;
std::cout << "Error alarm time hysteresis: " << (int)time_hist << " min" << std::endl;
std::cout << "Error alarm frequency: " << buzzer.freq_hz << " Hz" << std::endl;
std::cout << "Error alarm time on: " << buzzer.time_on_s << " s" << std::endl;
std::cout << "Error alarm time off: " << buzzer.time_off_s << " s" << std::endl;
time=170;
time=5;
battery.set_error_alarm(time,time_hist,&buzzer);
for(i=0;i<100;i++)
battery.get_warning_alarm(&time,&time_hist,&buzzer);
std::cout << "Warning alarm time: " << (int)time << " min" << std::endl;
std::cout << "Warning alarm time hysteresis: " << (int)time_hist << " min" << std::endl;
std::cout << "Warning alarm frequency: " << buzzer.freq_hz << " Hz" << std::endl;
std::cout << "Warning alarm time on: " << buzzer.time_on_s << " s" << std::endl;
std::cout << "Warning alarm time off: " << buzzer.time_off_s << " s" << std::endl;
time=10;
battery.set_warning_alarm(time,time_hist,&buzzer);
for(i=0;i<10000;i++)
{
battery.get_no_battery_output(&voltage,&current);
std::cout << "Voltage: " << voltage << " V, Current: " << current << " A" << std::endl;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment