Shake detection
Posted: 14 Sep 2016 20:47
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?
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?