Simplest IR remote on pi user state machine.
Minimal IR remote to user script implementation.

Simplest IR remote on pi user state machine.

As usual I start out trying to do things "the right way" often I find the layers of crap between my data and what I need to do way too much to figure out. This was one of those cases. I had no interest in tracking where and how inputs to keyboards and reparsing from keymaps and setting up the right user etc. happen. I just want to push buttons on random remotes, and in my case start and stop audio and video recordings without putting my instruments down and running across the room. This does that and only needs one thing ir-keytables to NOT change. Linux ALWAYS changes where things go and paradigms.

out.txt is a run I'm pushing 1's and 2's on 2 different remotes. userstate.sh is where a user would put their scripts. strt.one gets executed on first 'one' from train.txt which can be any collection of what any number of remotes put out for "one" strt.one.one is second 1 etc. If a state doesn't exist a try of strt.whatever is tried and that gets built up. comdefs.sh handles state transitions and support function to see if a 'state' really function exists or not. state.sh works around bash limitations and rebuilds main case script from scratch using a tiny awk (not shown hmm it's just { printf( "\"%s\") handle_state ${state} %s;;\n", $2, $1 ) } ) ir.c is a small parser to rip out everything but mode keyscan and repeat/toggle where appropriate from ir-keytable . Ideally we can talk someone at ir-keytable into providing us with this output. This only took a few minutes to get working, I did spend a few hours making it pretty and optimizing. I would still be fighting linux on permissions file locations

要查看或添加评论,请登录

Timothy Corrie Jr的更多文章

社区洞察

其他会员也浏览了