Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Upgraded push buttons
#2
For example, you can use this script and add the function time.

When starting the script, read time, from the last call and compare with the current time.

Code:
#!/bin/bash
t1=$(date +%s)
echo $t1
t2=$(cat time.log)
echo $t2
delta=$(( ($t1-$t2) ))
echo $t1 > time.log
echo $delta

if [ $delta -lt 2 ]
    then
        echo "Button pressed twice"
        double=1
fi

if the value $delta is small, you pressed the button twice.

like this you can extend the functions
Reply


Messages In This Thread
Upgraded push buttons - by pkdick - 04-28-2020, 05:23 PM
RE: Upgraded push buttons - by owagott - 04-29-2020, 07:12 AM
RE: Upgraded push buttons - by pkdick - 04-29-2020, 04:06 PM

Forum Jump: