/*
Copyright Isamu.Yamauchi 2013-2015. 2013.9.5, update 2014.12.21
This program uses the libpiface. thanks.
pepopiface.c is controls for Raspberry pi PiFace Digital I/O Expansion Board
*/
pepopiface are using Semaphore
First time to start without any options
[root@remote-hand ~]# pepopiface
** Welcome to pepopiface Version-0.3 Copyright Yamauchi.Isamu compiled:Dec 21 2014 **
usage:pepopiface port:0-8 [0|1] [timer:0-65535ms]
[root @ pepopiface] # ipcs -s
------ Semaphore Arrays --------
key semid owner perms nsems
0x530e3700 894009345 root 666 1
[root @ pepopiface] # ls /var/run/pepopiface.semaphore
Semaphore and file is created
usage:
[root@remote-hand ~]# pepopiface
** Welcome to pepopiface Version-0.3 Copyright Yamauchi.Isamu compiled:Dec 21 2014 **
usage:pepopiface port:0-8 [0|1] [timer:0-65535ms]
Concurrent read operation input port and output port
[root@remote-hand ~]# pepopiface 8
00ff[root@remote-hand ~]#
The high-order byte is the output port, the lower byte is the input port.
port0 write 1
[root@remote-hand ~]# pepopiface 0 1
1[root@remote-hand pepopiface]#
port0 write 0
[root@remote-hand ~]# pepopiface 0 0
0[root@remote-hand ~]#
port0 write 1 with timer
This operation is to "1" port of 0th 2 seconds.
[root@remote-hand ~]# pepopiface 0 1 2000
0[root@remote-hand ~]#
port0 read
[root@remote-hand ~]# pepopiface 0
1[root@remote-hand ~]#
Enjoy the piface and raspberry pi.