Page 1 of 1

Shake detection

Posted: 14 Sep 2016 20:47
by slypandemia
Hi, I'd be grateful for some help with this...

I have a flow that triggers when my car bluetooth is connected, it pops up a yes/no dialog asking if I want to start playing podcasts. That works fine, but I want to replace the dialog with a shake detection, eg if I shake the phone within 30 seconds of it connecting, start the podcast player.

I don't see a shake condition anywhere, only a trigger, so currently I have this:

In flow1;
global_shook = 0
enable flow2
sleep 30s
disable flow2
if global_shook == 1 play podcasts

In flow2;
trigger - shake
global_shook = 1

This seems overcomplicated, and also it always waits the full 30s whereas I would prefer it to start playback as soon as the shake gesture is detected.

Is there a better way?

Re: Shake detection

Posted: 14 Sep 2016 22:14
by MURTUMA
In flow1;
enable flow2
sleep 30s
disable flow2

In flow2;
trigger - shake
Action to start the podcast.
Disable flow2.


This would be one way to do this. Whether this is better solution that yours depends on how you have built the flows as whole. If they're as simple as in your example, then this might work better.

Re: Shake detection

Posted: 15 Sep 2016 20:00
by slypandemia
Thanks, actually that works really well for me.