Closed bphermansson closed 6 years ago
It's adafruit_CCS811
not adafruit_ccs811
-- capitalization matters.
Then again, all other libraries use lowercase names, so we should probably fix that.
Try this instead:
import busio
import adafruit_ccs811
from board import *
i2c_bus = busio.I2C(SCL, SDA)
ccs = adafruit_ccs811.CCS811(i2c_bus)
@bphermansson Please reopen if that doesn't help.
That works but gives another problem, my CCS811 is found at 0x5b, nor 0x5a, so the code fails anyway.
Then you have to specify the I²C address:
ccs = adafruit_ccs811.CCS811(i2c_bus, address=0x5b)
ccs = adafruit_ccs811.CCS811(i2c_bus, address=0x5b)
File "code.py", line 5, in
TypeError: unexpected keyword argument 'address'
Sorry, they used "addr" for some reason.
Ok thanks for a quick answer, finally it works!
I have put the CircuitPython bundle in the lib folder of my ItsyBitsy M0 Express. In the bundle theres a driver for the CCS811. I then try the following code:
But I get an error:
Why?