I tried your suggestion and spent some time over the weekend reading the documentation and trying various things (tried 16g, higher Hz and various other settings that I'm certain I do not understand fully) but I always end up with the same problem as before:
Out: -6000
Closed: 0
In: +6000
Closed: 0
Your solution pretty much follows examples they provide, and it even discusses how the first reading is effectively an anomaly and ways you can deal with it - I see the anomaly but it doesn't affect me. Even with 16g I still get some silly high numbers in the opposite direction when it closes.
The only thing that seems to work is to set 10h back to high power Puck.accelWr(0x15,0x00), whilst leaving all the other settings more or less as you suggested. Then I get as expected:
OUT: -6308
CLOSED: 1575
I thought this might be "good enough", but I'm not convinced the battery will last all that much longer... Am I wrong? Considering the issue is likely to be 'noise' on low power mode I tried normal mode:
While High-Performance mode guarantees the best performance in terms of noise, Normal mode further reduces the current consumption.
I don't know if it helped, but it definitely didn't solve the issue. I don't understand the configuration options (slopes/filters/etc) well enough to know if there's a combination that will further reduce the power consumption and work as it does on high performance in reaction to the flap closing.
If all else fails I can always add a hack solution to ignore an in/out action after the flap is registered closed for a couple of seconds! :-D
@allObjects - Thanks for sharing the links, really interesting! I'd loved to find some time to do something similar - perhaps even for a time restricted feeder.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I tried your suggestion and spent some time over the weekend reading the documentation and trying various things (tried 16g, higher Hz and various other settings that I'm certain I do not understand fully) but I always end up with the same problem as before:
Your solution pretty much follows examples they provide, and it even discusses how the first reading is effectively an anomaly and ways you can deal with it - I see the anomaly but it doesn't affect me. Even with 16g I still get some silly high numbers in the opposite direction when it closes.
The only thing that seems to work is to set 10h back to high power
Puck.accelWr(0x15,0x00)
, whilst leaving all the other settings more or less as you suggested. Then I get as expected:I thought this might be "good enough", but I'm not convinced the battery will last all that much longer... Am I wrong? Considering the issue is likely to be 'noise' on low power mode I tried normal mode:
I don't know if it helped, but it definitely didn't solve the issue. I don't understand the configuration options (slopes/filters/etc) well enough to know if there's a combination that will further reduce the power consumption and work as it does on high performance in reaction to the flap closing.
If all else fails I can always add a hack solution to ignore an in/out action after the flap is registered closed for a couple of seconds! :-D
@allObjects - Thanks for sharing the links, really interesting! I'd loved to find some time to do something similar - perhaps even for a time restricted feeder.