Skip to content
Snippets Groups Projects
Commit ff8aa0d6 authored by Armin Co's avatar Armin Co
Browse files

Cleanup

parent 70fc86dc
Branches
No related tags found
No related merge requests found
......@@ -105,7 +105,7 @@ void SmartGridModell::set_output_pin(Pin pin, uint8_t value)
bool succ = m_modell.send(static_cast<uint8_t>(pin), value);
spdlog::debug("Send: {} {}, success: {}", pin, value, succ);
using namespace std;
this_thread::sleep_for(chrono::milliseconds(250));
this_thread::sleep_for(chrono::milliseconds(10));
}
void SmartGridModell::set_house_color(House number, uint8_t red, uint8_t green)
......
......@@ -93,20 +93,17 @@ int main()
// sim mode
// run loop
i2c::Node arduino{0x14};
if (false == arduino.open_device("/dev/i2c-1"))
i2c::Node i2c_device {0x14};
if (false == i2c_device.open_device("/dev/i2c-1"))
{
spdlog::error("Failed to open device. Exiting...");
exit(1);
}
spdlog::debug("Node created");
SmartGridModell modell{arduino};
SmartGridModell modell{i2c_device, SmartGridModell::DefaultState::Fancy};
spdlog::debug("Modell created");
using namespace std;
modell.set_power_plant(21);
modell.set_solar_plant(21);
// ModelState state {};
// bool simulation_is_running {true};
......@@ -115,7 +112,7 @@ int main()
// state.next_step();
// }
modell.put_modell_into_state(SmartGridModell::DefaultState::Off);
spdlog::info("End");
return 0;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment