nerves-livebook / nerves_livebook

Develop on embedded devices with Livebook and Nerves
Apache License 2.0
279 stars 39 forks source link

Add I2C tutorial #4

Open fhunleth opened 3 years ago

fhunleth commented 3 years ago

I'm not sure what device to use, but it would be cool to get a simple tutorial that shows how to detect a device and doing doing something simple with it.

takasehideki commented 3 years ago

I have a suggestion to the I2C device. How do you feel about Seeed Grove device? We (NervesJP) have used the AHT20 I2C module at the hands-on tutorial for Nerves. https://www.seeedstudio.com/Grove-AHT20-I2C-Industrial-grade-temperature-and-humidity-sensor-p-4497.html

It can obtain temperature and humidity at the same time though I2C communication. It is very inexpensive and enables highly accurate measurement. However, an additional shield such as Grove Base HAT is required to connect to the Raspberry Pi.

The code for the driver we developed can be found here (comment line is Japanese :) https://github.com/NervesJP/nervesjp_basis/blob/main/lib/sensor/aht20.ex

If you like my idea, please give me a time to integrate this sample into Livebook. I wanna enjoy the development experience of Nerves Livebook.

fhunleth commented 3 years ago

I think that's a great device for a tutorial since it is both inexpensive and has a simple I2C interface. Thank you for the suggestion.