Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Unimplemented Methods PR #341

Merged
merged 5 commits into from
Apr 18, 2020
Merged

Unimplemented Methods PR #341

merged 5 commits into from
Apr 18, 2020

Conversation

andreamah
Copy link
Contributor

Description:

Instead of having unimplemented method printing to terminal, it prints just to output console. This was because the printing of long strings containing unimplemented methods was causing issues with performance and multithreading.

The long string issue may be fixed in a future PR.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Testing:

from adafruit_clue import clue

clue.sea_level_pressure = 1020

clue_data = clue.simple_text_display(title="CLUE Sensor Data!", title_scale=2)

while True:
    clue_data[0].text = "Acceleration: {:.2f} {:.2f} {:.2f} m/s^2".format(
        *clue.acceleration
    )
    clue_data[1].text = "Gyro: {:.2f} {:.2f} {:.2f} dps".format(*clue.gyro)
    clue_data[2].text = "Magnetic: {:.3f} {:.3f} {:.3f} uTesla".format(*clue.magnetic)
    clue_data[3].text = "Pressure: {:.3f} hPa".format(clue.pressure)
    clue_data[4].text = "Altitude: {:.1f} m".format(clue.altitude)
    clue_data[5].text = "Temperature: {:.1f} C".format(clue.temperature)
    clue_data[6].text = "Humidity: {:.1f} %".format(clue.humidity)
    clue_data[7].text = "Proximity: {}".format(clue.proximity)
    clue_data[8].text = "Gesture: {}".format(clue.gesture)
    clue_data[9].text = "Color: R: {} G: {} B: {} C: {}".format(*clue.color)
    clue_data[10].text = "Button A: {}".format(clue.button_a)
    clue_data[11].text = "Button B: {}".format(clue.button_b)
    clue_data[12].text = "Touch 0: {}".format(clue.touch_0)
    clue_data[13].text = "Touch 1: {}".format(clue.touch_1)
    clue_data[14].text = "Touch 2: {}".format(clue.touch_2)
    clue_data.show()

Should show the sensor data and not the unimplemented methods warnings.

Copy link
Contributor

@isadorasophia isadorasophia left a comment

Choose a reason for hiding this comment

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

LGTM!

@xnkevinnguyen
Copy link
Contributor

Thanks for the nit change! Good solution

@xnkevinnguyen xnkevinnguyen merged commit 5072861 into dev Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants