mirror of
https://github.com/SasaKaranovic/HousePlantMonitoringSystem.git
synced 2026-07-08 17:52:37 +02:00
Updating I2C comms.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#include "logger.h"
|
||||
|
||||
|
||||
#define I2C_ADDRESS (0x1F << 1)
|
||||
#define I2C_ADDRESS (0x10 << 1)
|
||||
#define I2C_TIMING 0x20602938 /* 100 kHz with analog Filter ON, Rise Time 400ns, Fall Time 100ns */
|
||||
#define I2C_BUFF_LEN 30
|
||||
|
||||
|
||||
@@ -103,9 +103,10 @@ static void PlantSystem_ProcessRequest(void)
|
||||
{
|
||||
pTXBuff[0] = CMD_GET_TEMPERATURE;
|
||||
pTXBuff[1] = DATATYPE_SINGLE_VALUE;
|
||||
pTXBuff[2] = 2;
|
||||
Sensors_GetTemperatureReading(&pTXBuff[3], &pTXBuff[4]);
|
||||
nTXBufferLen = 5;
|
||||
pTXBuff[2] = 0;
|
||||
pTXBuff[3] = 2;
|
||||
Sensors_GetTemperatureReading(&pTXBuff[4], &pTXBuff[5]);
|
||||
nTXBufferLen = 6;
|
||||
Logger_INFO("T");
|
||||
}
|
||||
break;
|
||||
@@ -115,9 +116,10 @@ static void PlantSystem_ProcessRequest(void)
|
||||
{
|
||||
pTXBuff[0] = CMD_GET_SOILMOISTURE;
|
||||
pTXBuff[1] = DATATYPE_SINGLE_VALUE;
|
||||
pTXBuff[2] = 4;
|
||||
Sensors_GetSoilMoistureReading(&pTXBuff[3], &pTXBuff[4], &pTXBuff[5], &pTXBuff[6]);
|
||||
nTXBufferLen = 7;
|
||||
pTXBuff[2] = 0;
|
||||
pTXBuff[3] = 4;
|
||||
Sensors_GetSoilMoistureReading(&pTXBuff[4], &pTXBuff[5], &pTXBuff[6], &pTXBuff[7]);
|
||||
nTXBufferLen = 8;
|
||||
Logger_INFO("M");
|
||||
}
|
||||
break;
|
||||
@@ -127,9 +129,10 @@ static void PlantSystem_ProcessRequest(void)
|
||||
{
|
||||
pTXBuff[0] = CMD_GET_AMBIENTLIGHT;
|
||||
pTXBuff[1] = DATATYPE_SINGLE_VALUE;
|
||||
pTXBuff[2] = 4;
|
||||
Sensors_GetAmbientLightReading(&pTXBuff[3], &pTXBuff[4], &pTXBuff[5], &pTXBuff[6]);
|
||||
nTXBufferLen = 7;
|
||||
pTXBuff[2] = 0;
|
||||
pTXBuff[3] = 4;
|
||||
Sensors_GetAmbientLightReading(&pTXBuff[4], &pTXBuff[5], &pTXBuff[6], &pTXBuff[7]);
|
||||
nTXBufferLen = 8;
|
||||
Logger_INFO("A");
|
||||
}
|
||||
break;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user