Native Support for ON/OFF/ON Switches
- BradyBrother100
- Posts: 54
- Joined: Tue Oct 13, 2020 4:21 pm
- Location: United States MDT
Re: Native Support for ON/OFF/ON Switches
HI! I think Corjan's code would be a great implementation into Air Manager.
Re: Native Support for ON/OFF/ON Switches
Hi Brady,
For some reason I can't seem to reply to your PM ????
Anyway, here is a link to, and a brief description of the 12 way rotary switches you asked for - the ones that can be set mechanically for any number of position from 1 to 12.
https://siminnovations.com/forums/viewt ... 929#p34929
Regards,
Joe
For some reason I can't seem to reply to your PM ????
Anyway, here is a link to, and a brief description of the 12 way rotary switches you asked for - the ones that can be set mechanically for any number of position from 1 to 12.
https://siminnovations.com/forums/viewt ... 929#p34929
Regards,
Joe
Joe. CISSP, MSc.
- BradyBrother100
- Posts: 54
- Joined: Tue Oct 13, 2020 4:21 pm
- Location: United States MDT
Re: Native Support for ON/OFF/ON Switches
Hey! In Air Manager 4.X, will the ability to assign multiple pins to the hw_input_add be added?
Thanks!
Brady
Thanks!
Brady
Re: Native Support for ON/OFF/ON Switches
Hi,
Will be part of the next (free) upgrade, AM 4.1.
Corjan
Will be part of the next (free) upgrade, AM 4.1.
Corjan
Re: Native Support for ON/OFF/ON Switches
I had the same problem with those 3 pin switches so instead of using:
I used:
It works well even for the initial state of the switch when the program begins.
Code: Select all
function switch_callback(position)
print("Switch pos " .. position)
end
hw_switch_add("ARDUINO_MEGA2560_D_D4", "ARDUINO_MEGA2560_D_D6", switch_callback) --ON/OFF/ON switch
Code: Select all
function dn_switch_callback(position)
pos_down=position
checkMidPosition()
print("Down position " .. position)
end
hw_switch_add("ARDUINO_MEGA2560_D_D4", dn_switch_callback)
function up_switch_callback(position)
pos_up=position
checkMidPosition()
print("Up position " .. position)
end
hw_switch_add("ARDUINO_MEGA2560_D_D6", up_switch_callback)
function checkMidPosition()
if pos_up==0 and pos_down==0 then pos_mid=1 print("Mid position 1") else pos_mid=0 print("Mid position 0") end
end
- BradyBrother100
- Posts: 54
- Joined: Tue Oct 13, 2020 4:21 pm
- Location: United States MDT
Re: Native Support for ON/OFF/ON Switches
Ah, looks like this didn’t make the cut after all
You could make this in pure lua,
Corjan
You could make this in pure lua,
Corjan
Re: Native Support for ON/OFF/ON Switches
It's indeed easy to make in Lua with two digital inputs. I think there's even a pre made hardware function available in Air Manager. You would only have to add your commands or events.
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Native Support for ON/OFF/ON Switches
Hi,
So it will be in beta AM4.2 build(1)
If this is going to happen? Then add OFF ON ON as well please.
Keith
So it will be in beta AM4.2 build(1)
If this is going to happen? Then add OFF ON ON as well please.
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
Re: Native Support for ON/OFF/ON Switches
I don't see any urgency, since it can easily be done in Lua.