Skip to content

Conversation

victorcoman
Copy link

No description provided.

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

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?

# 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.


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