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

Implement dunder str #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

bronsen
Copy link

@bronsen bronsen commented Nov 2, 2020

This implements __str__ for CCS811.

I just changed s. to self., and renamed the function.

It seems to work now :)

>>> from machine import Pin, I2C
>>> from CCS811 import CCS811
>>> i2c = I2C(scl=Pin(5), sda=Pin(4))
>>> sensor = CCS811(i2c=i2c, addr=0x5a)
>>> print(sensor)
eCO2: 0 ppm, TVOC: 0 ppb

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.

1 participant