Skip to content

Conversation

victorcoman
Copy link

No description provided.

Signed-off-by: Victor Coman <victor.coman@digi.com>
Signed-off-by: Victor Coman <victor.coman@digi.com>
Signed-off-by: Victor Coman <victor.coman@digi.com>
… each time the application is restarted

Signed-off-by: Victor Coman <victor.coman@digi.com>
-before it gave an exception, now it returns true

Signed-off-by: Victor Coman <victor.coman@digi.com>
return get_next_random(wind, WIND_MAX, WIND_MIN, WIND_DELTA)
else:
# Conversion from miles/h to km/h
return round(wind * 1.609, 1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be more elegant to have a separated function to convert to km/h and call it here.

wind_dir = meas_items["current_windDirection_List"]
luminosity = meas_items["lightVal"]

# meas_data = [temp, moist, pres, rain, wind, wind_dir, luminosity]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these comments

@@ -1200,7 +1409,11 @@ def main():
# Start a task to get the status from the irrigation stations.
status_task()

# TODO: Remove for final version as main controller is set in the provisioning step.
set_main_controller(True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be removed, then?


while True:
start_time = time.time()

# Reset the rain at midnight.
if (current_time + time_factor) // SECONDS_PER_DAY > 0:
# Create and configure the serial port settings
ser = serial.Serial()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this instantiation conflict with the port created in the read_microbit() method? Maybe we should declare the serial port as global and use it in both methods.

@@ -1165,6 +1405,22 @@ def main():

global device, current_time

# Create and configure the serial port settings
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated block of code, it would be better to have a method that resets the microbit board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants