button override

FUZIK

New Member
Joined
Jul 17, 2018
Messages
2
Reaction score
0
Country
Belarus
on my cam broken 'shutter' button. I have an idea override 'switch button' button to shutter.
Code:
'switch button' -> one click = shutter
                   two click = switch mode
who can help me understand gpio command in .sh?
 
my sample spaghetti code
Code:
#!/bin/sh

while true
    if (state of swith button) != 0
        swith button # or cancel switch
        if(firstclick == 1)
            shutter button
        else
            click_check()


click_check()
    if(firstclick == 0)
        firstclick -> 1
        wait 0.3 # seconds
        firstclick -> 0
 
Back
Top