Modified EspEasySlave to read digital values and store the needed pin number, then return it as analog read

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
quasar66
New user
Posts: 6
Joined: 18 Aug 2017, 22:20

Modified EspEasySlave to read digital values and store the needed pin number, then return it as analog read

#1 Post by quasar66 » 21 Aug 2017, 20:22

I needed to read 6 sensors very fast (at least a couple of times per second). Each sensor returns 0 if a device is in front of it. I need that data exposed at ~1/s to mqtt.

Having worked with the EspEasy library I modified the EspEasySlaves library to make an Arduino Uno Slave that:
- on start, the location is set to 0
- reads 6 sensors very fast (~10 times per second) - D2 to D7
- saves in memory the first sensor that has value 0 (for pin D2 saves 1, for pin D7 saves 6)
- when pin A4 or A5 is read by EspEasy via I2C, it returns the stored location as a fake analog read

https://github.com/yahat/ESPEasySlaves_ ... igitalPins

When I have time I'll try to make it a full plugin.

Who is online

Users browsing this forum: Anthropic Claude Bot [bot], Perplexity.ai [bot] and 13 guests