Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vcoman/ces demo #14

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Vcoman/ces demo #14

wants to merge 5 commits into from

Conversation

victorcoman
Copy link
Collaborator

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

@@ -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