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

Added delayed sending.

parent 797edc55
Branches
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
#include <SmartGridModell.hpp>
#include <spdlog/spdlog.h>
#include <thread>
SmartGridModell::SmartGridModell(i2c::Node& node, DefaultState initial_state)
: m_modell{node}
......@@ -102,9 +102,10 @@ void SmartGridModell::set_renewable_net(uint8_t brightness)
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));
}
void SmartGridModell::set_house_color(House number, uint8_t red, uint8_t green)
......
......@@ -83,9 +83,6 @@ constexpr float power_wind[] {
int main()
{
spdlog::info("start");
std::this_thread::sleep_for(std::chrono::seconds(3));
spdlog::info("end");
// Intialisation
// put model into a base state
// Intialise environment data
......@@ -96,7 +93,7 @@ int main()
// run loop
i2c::Node arduino{0x14};
if (!arduino.open_device("/dev/i2c-1"))
if (false == arduino.open_device("/dev/i2c-1"))
{
spdlog::error("Failed to open device. Exiting...");
exit (1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment