Appendix D. Class library for Sense HAT sensors
In this appendix, I show you how to develop the Portable Class Library (PCL) and reference it in other projects. The idea is to build a reusable PCL that can be shared across various projects. You can even reuse the common C# code between different platforms.
You use the I2C interface to associate communication with all the Sense HAT sensors. To read and write data through this interface, UWP implements the I2cDevice
class. Given the raw bytes obtained from a sensor, you then convert them to meaningful values. The conversion logic is platform-independent, contrary to the I2cDevice
object, which is inherent to UWP. Hence, the conversion logic could be used on different platforms, which most likely ...
Get Programming for the Internet of Things: Using Windows 10 IoT Core and Azure IoT Suite now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.