Create payload.sh

pull/377/head
TheDragonkeeper 2019-04-08 18:43:01 +01:00 committed by GitHub
parent 6760498c27
commit f573cb9b0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
function RUN_PAYLOAD() {
payloadcount=$#
payloadarray=("$@")
PAYLOAD=1
LED R
sleep 3
while [ $payloadcount -ge $PAYLOAD ]; do
LED R
GET SWITCH_POSITION
TEST=$SWITCH_POSITION
LED B
sleep 2
GET SWITCH_POSITION
if [ $SWITCH_POSITION == $TEST ]; then
LED G
"${payloadarray[0]}""${payloadarray["$PAYLOAD"]}"
return
fi
LED G FAST
PAYLOAD=$((PAYLOAD+1))
sleep 1
done
}
export -f RUN_PAYLOAD