How to connect button to MIO module?
-
- Posts: 5
- Joined: 24 Jun 2024, 22:17
How to connect button to MIO module?
I would like to connect a button/switch to RevPi MIO module. How to wire it properly?
Re: How to connect button to MIO module?
Great idea, you can start by this helpful knowledge base article that guides you wring and commissioning:
Commissioning RevPi MIO
And have a look at this video tutorial where we connect a button to a DIO Module - just adapt the steps according to your MIO Module.
Tutorial 12 – Digital IO Modules application example
Commissioning RevPi MIO
And have a look at this video tutorial where we connect a button to a DIO Module - just adapt the steps according to your MIO Module.
Tutorial 12 – Digital IO Modules application example
-
- Posts: 5
- Joined: 24 Jun 2024, 22:17
Re: How to connect button to MIO module?
This is helpful. I need additional help with understanding wiring.
To which pins of the MIO module can I safely connect a button or switch? I am looking for a simple diagram similar to this one for Raspberry Pi: https://projects.raspberrypi.org/en/pro ... omputing/5
Can I connect a switch to one of Digital Inputs and the Ground as shown on the attached image?
To which pins of the MIO module can I safely connect a button or switch? I am looking for a simple diagram similar to this one for Raspberry Pi: https://projects.raspberrypi.org/en/pro ... omputing/5
Can I connect a switch to one of Digital Inputs and the Ground as shown on the attached image?
Re: How to connect button to MIO module?
Hi take a look at this I hope it helps you
May the source be with you
May the source be with you
Code: Select all
# toggle RevPi MIO digital output 1
import revpimodio2
import time
rpi = revimodio2.RevPiModIO(autorefresh=True)
OutputValue=True
while True
rpi.io.DigitalOutput_1.value=OutputValue
time.sleep(0.5)
OutputValue = not OutputValue
Re: How to connect button to MIO module?
Hi curious-eng, sorry I forgot to answer your question as I did not have a button around but a LED.
So, to sum it up, you can connect a button by wiring it the way you did with digital input 1.
Open PiCtory and configure the variable of the MIO module "IO_Mode_1" as digital input.
Then save the PiCtory configuration.
Finally, open a shell and type
The value 1/0 should reflect the circuit state closed/opened of your button.
So, to sum it up, you can connect a button by wiring it the way you did with digital input 1.
Open PiCtory and configure the variable of the MIO module "IO_Mode_1" as digital input.
Then save the PiCtory configuration.
Finally, open a shell and type
Code: Select all
piTest -x # reset piControl
piTest -r DigitalInput_1 # read continously input 1