Open kristianpedersen opened 5 years ago
Here's how I set up my micro:bit with the Arduino IDE for those who are interested: https://learn.adafruit.com/use-micro-bit-with-arduino?view=all
great and for my students step forward. Do you have some images of how you set this up with the wirers
The sensor we got is this https://nl.aliexpress.com/item/32820864503.html?aff_platform=product&sk=b0kN9BLE&aff_trace_key=dbfc44fbef034f3e9914720a3f8477ea-1600332411778-03544-b0kN9BLE&terminal_id=572a9b244f20404bb6b192346a9d9ad7
thanks @kristianpedersen
I don't have the sensor available anymore, but here's the wiring I used:
And here are the corresponding pins on the micro:bit
https://microbit-micropython.readthedocs.io/en/v1.0.1/pin.html
At first when using your library, I only got one static reading showing unrealistically high eCO2 values. Often at around 65000.
I then discovered the sensor works great with Arduino IDE and Sparkfun's CCS811 library. The eCO2 values stay at around 400, and increase significantly when I breathe on the sensor.
Finally, I discovered that your library does work! If I first transfer an Arduino sketch and then transfer my code with your MakeCode library, I get expected readings. If I pull the USB plug and put it back in, the readings go back to being static again.
Here are the respective error and status codes MakeCode gives me: Successful readings: Error 0, status alternates between 144 and 152. Unsuccessful readings: Error 3, status 16
Here's an example of a log, where you can see where the USB was pulled out and put back in. As you can see, the bottom line has been repeated 741 times:
My Arduino program:
My MakeCode program:
The sensor has been connected using 3.3V, GND, SDA and SCL.