This is library for Azure Sphere MT3620 Grove Shield, the shield enhences Azure Sphere by adding I2C interface and Analog input.
- Operation Systems - Windows 10 or Ubuntu 18.04
- Developer Tools: Visual Studio Visual Studio Community/Professional/Enterprise or Visual Studio Code
- Hardware - Azure Sphere, MT3620 Grove Shield
Review the Azure Sphere documentation for the guide to setting up the developer tools and Azure Sphere SDK on Windows 10 or Ubuntu 18.04.
Select app_manifest.json in the application project, add the below attributions, so that we can use the peripherals that MT3620 Grove Shield would use.
"Capabilities": {
"Gpio": [ 8, 9, 10, 15, 16, 17, 18, 19, 20, 12, 13, 0, 1, 4, 5, 57, 58, 11, 14, 48 ],
"Uart": [ "ISU0", "ISU3" ],
"AllowedApplicationConnections": []
}
When using a hardware definition file, you must use an identifier for app_manifest.json.
"Capabilities": {
"Gpio": [ "$MT3620_GPIO8", "$MT3620_GPIO9", "$MT3620_GPIO10", "$MT3620_GPIO15", "$MT3620_GPIO16", "$MT3620_GPIO17", "$MT3620_GPIO18", "$MT3620_GPIO19", "$MT3620_GPIO20", "$MT3620_GPIO12", "$MT3620_GPIO13", "$MT3620_GPIO0", "$MT3620_GPIO1", "$MT3620_GPIO4", "$MT3620_GPIO5", "$MT3620_GPIO57", "$MT3620_GPIO58", "$MT3620_GPIO11", "$MT3620_GPIO14", "$MT3620_GPIO48" ],
"Uart": [ "$MT3620_ISU0_UART", "$MT3620_ISU3_UART" ],
"AllowedApplicationConnections": []
}
Here for details of the hardware definition file.
- Grove.h
- Sensors/Grove4DigitDisplay.h
- Sensors/GroveRelay.h
- Sensors/GroveTempHumiBaroBME280.h
- Sensors/GroveTempHumiSHT31.h
- Sensors/GroveAD7992.h
- Sensors/GroveOledDisplay96x96.h
- Sensors/GroveRelay.h
- Sensors/GroveRotaryAngleSensor.h
- Sensors/GroveLEDButton.h
- Sensors/GroveLightSensor.h
- Add headers
#include "Grove.h"
#include "Sensors/GroveTempHumiSHT31.h"
- Initialize the shield in main() function
int i2cFd;
GroveShield_Initialize(&i2cFd, 115200); // baudrate - 9600,14400,19200,115200,230400
- Initialize and instantiation
void* sht31 = GroveTempHumiSHT31_Open(i2cFd);
- Read temp and humidiy from the sensor
GroveTempHumiSHT31_Read(sht31);
float temp = GroveTempHumiSHT31_GetTemperature(sht31);
float humi = GroveTempHumiSHT31_GetHumidity(sht31);