Page 1 of 1

TaskInterval less then one Second for Shock detection

Posted: 05 Dec 2021, 10:08
by leszek77
Hi,

i just wondering if I can lower TaskInterval to less then one second. I want detect shocks.

I have an punch box for my son and I want detect the punches. The punch is shorter then an second so this means it can be undetected.

Currently I have 3 approches what not works so well.
- Analog in
- gyro 6050
- Force Sensor analog out or peak digital out.

but so far I don't get good results.

Solution would be lower TaskInterval to 100ms or can do an switch-off delay for gpio?

thank you

Re: TaskInterval less then one Second for Shock detection

Posted: 05 Dec 2021, 10:18
by Ath
ESPEasy doesn't have that fine-grained configuration for Interval, as it uses that to send data out to Controllers as well.
Some devices do send events to be handled from rules at every measurement, you have to enable Rules in the Tools/Advanced page for that. Not sure if the 6050 plugin does that, though, I'll check later when the laptop is fired up ;)

I've started a plugin for an accellerometer sensor, I'll see if that can be included.

Re: TaskInterval less then one Second for Shock detection

Posted: 05 Dec 2021, 13:29
by Ath
the MPU6050 Gyro sensor does only get a measurement once a second, so increasing the Interval isn't going to help for that plugin.

The Accelerometer ADXL345 does support sending events when 'tapped' (that can be enabled separately), Plugin P120 will add support for the I2C version of that type of board. If you have that type of board available, you can get a testbuild (Download from here, you will need the TEST_D build).

Re: TaskInterval less then one Second for Shock detection

Posted: 05 Dec 2021, 14:28
by Ath
And here's a preliminary version of the documentation:
(Zipped pdf file)