NRU Series
25
23
unconnected
24
25
DIO Script Sample
In the following sample bash script, you can see how to access the DIO in Linux.
# DIO GPIO Pin
DO0=320
DO1=321
DO2=322
DO3=323
DI1=325
DI2=331
DI3=326
function exposeDI() {
## Expose DI to User Space
echo $1 >/sys/class/gpio/export 2>/dev/null
echo in >/sys/class/gpio/gpio$1/direction
}
function exposeDO() {
echo $1 >/sys/class/gpio/export 2>/dev/null
echo out >/sys/class/gpio/gpio$1/direction
}
function setDO() {
echo $2 >/sys/class/gpio/gpio$1/value
}
function getDO() {
cat /sys/class/gpio/gpio$1/value
}
### Initial DI
exposeDI $DI1
exposeDI $DI2
Содержание NRU Series
Страница 14: ...NRU Series 14 1 3 3 Rear Panel View 1 3 4 Bottom View ...
Страница 15: ...NRU Series 15 1 3 5 Anti vibration Mount Dimensions ...
Страница 42: ...NRU Series 42 5 Remove the two screws indicated on the rear panel 6 Remove the two screws indicated ...
Страница 43: ...NRU Series 43 7 Gently pull apart the enclosure ...
Страница 52: ...NRU Series 52 7 Secure the bottom panel with six screws four screws secure the four rubber stands ...