/*
Copyright Isamu.Yamauchi 2013-2015. 2013.9.5, update 2015.1.11
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.5 Copyright Yamauchi.Isamu compiled:Jan 11 2015 **
usage:pepopiface port:0-8 [0|1] [timer:0-65535ms]


[root@pepopiface-0.5]# ipcs -s

------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0x530e268d 894861312  root       666        1
[root@pepopiface-0.4]# ls /var/run/pepopiface.semaphore
/var/run/pepopiface.semaphore
[root@pepopiface-0.5]#

Semaphore and file is created

usage:
[root@remote-hand ~]# pepopiface

** Welcome to pepopiface Version-0.5 Copyright Yamauchi.Isamu compiled:Jan 11 2015 **
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.
