Skip to content

Commit fd86c93

Browse files
authored
Merge pull request letscontrolit#2810 from uzi18/dallas
LM75A - add multiple sensors support letscontrolit#2808
2 parents 4ae0a97 + 819f9ba commit fd86c93

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/_P069_LM75A.ino

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ public:
5959
//Wire.begin(); called in ESPEasy framework
6060
}
6161

62+
void setAddress(uint8_t addr)
63+
{
64+
_i2c_device_address = addr;
65+
}
66+
6267
float getTemperatureInDegrees() const
6368
{
6469
float real_result = INVALID_LM75A_TEMPERATURE;
@@ -176,6 +181,8 @@ boolean Plugin_069(byte function, struct EventStruct *event, String& string)
176181
if (!PLUGIN_069_LM75A)
177182
return success;
178183

184+
PLUGIN_069_LM75A->setAddress((uint8_t)PCONFIG(0));
185+
179186
float tempC = PLUGIN_069_LM75A->getTemperatureInDegrees();
180187

181188
if (tempC == INVALID_LM75A_TEMPERATURE)

0 commit comments

Comments
 (0)