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

Updates to config

parent 9e1db5df
Branches
No related tags found
No related merge requests found
......@@ -58,13 +58,13 @@ void SmartGridModell::update_windmill_speed(uint8_t speed)
{
set_output_pin(Pin::WindmillMotor, speed);
}
else if (speed > 20)
else if (speed == 0)
{
set_output_pin(Pin::WindmillMotor, min_motor_speed);
set_output_pin(Pin::WindmillMotor, 0);
}
else
{
set_output_pin(Pin::WindmillMotor, 0);
set_output_pin(Pin::WindmillMotor, min_motor_speed);
}
}
......
......@@ -109,8 +109,8 @@ private:
}
void update_wind()
{
double wind_by_sun = m_sun * 5.0 / 100.0; // wind by sun should by 5 max.
auto random_wind = ((std::rand() * 1.0) / RAND_MAX) * 7.0;
double wind_by_sun = m_sun * 7.0 / 100.0; // wind by sun should by 5 max.
auto random_wind = ((std::rand() * 1.0) / RAND_MAX) * 5.0;
m_wind = power_wind[static_cast<int>(wind_by_sun + random_wind)];
}
void update_power_consumption()
......@@ -209,7 +209,7 @@ void run_sim()
while (active)
{
day.next_hour();
std::this_thread::sleep_for(std::chrono::seconds(1));
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment