forked from coders-school/fan_controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
30 lines (25 loc) · 770 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "Controller.hpp"
#include "Thermometer.hpp"
#include "SlowThermometer.hpp"
#include "Fan.hpp"
#include "LcdDisplay.hpp"
#include <memory>
#include <iostream>
int main()
try {
SlowThermometer t;
TinyFan f;
double targetTemperature = 36.6;
double tolerance = .5;
auto display_ptr = std::make_shared<LcdDisplay>();
// Controller oldController{t, f, targetTemperature, tolerance, nullptr};
// oldController.updateRpm();
// oldController.displayInfo();
Controller newController{t, f, targetTemperature, tolerance, display_ptr};
newController.updateRpm();
newController.displayInfo();
return 0;
} catch (const std::exception & e) {
std::cerr << e.what() << '\n';
return -1;
}