Page 1 of 2

how to use picontrol?

Posted: 07 Jan 2020, 02:19
by huanghuapan
Hi sir,we don't know how to use piControl,We don't know how to use the functions in the code,Do you have any instructions about the header files and functions of piControl?

Re: how to use picontrol?

Posted: 07 Jan 2020, 09:35
by nicolaiB
A good starting point is the piTest source code which you can find in the home directory of the Pi user on every RevPi. The source code is also available on the revPi repository on Github.

Nicolai

Re: how to use picontrol?

Posted: 07 Jan 2020, 13:23
by huanghuapan
Thank you,NicolaiB,but we have the piTest code,but we don't know how to use the function of piControl,we want to know how to use this code.do you know ?

Re: how to use picontrol?

Posted: 07 Jan 2020, 13:47
by nicolaiB
The piTest program makes use of the piControl device and is therefore a good reference. Do you have a specific example where you got stuck with ?

Re: how to use picontrol?

Posted: 07 Jan 2020, 14:53
by huanghuapan
The current requirement is that I read the value of a single DI channel of the DIO module to trigger the action of DO, or read the value of a single channel of AIO, and there is a write to the AO channel

We use piTest -r variable name, What type is the return value of a single variable and how to use this return value to drive piTest -w variable name Value

It is that
if (piTest -r variable name)
            piTest -w variable name value
        endif
How to write it?

Re: how to use picontrol?

Posted: 07 Jan 2020, 17:24
by dirk
Hi huanghuapan, well I would prefer to use Python and the RevPiModIO library here. Hi have a look at this snippet here:
viewtopic.php?f=6&t=1626&p=6250&hilit=mirror#p6250

Re: how to use picontrol?

Posted: 13 Jan 2020, 12:14
by huanghuapan
Hi,Dirk
Now we use the AIO module,When I read the value of a single channel of AIO, and how to write to the AO channel,how to use RevPiModIO?

Re: how to use picontrol?

Posted: 15 Jan 2020, 14:41
by dirk
Hi, here are some example scripts:
example scripts.zip
(1.35 KiB) Downloaded 461 times

Re: how to use picontrol?

Posted: 16 Jan 2020, 12:20
by huanghuapan
Thank you,Dirk,These example scripts can use in AIO modules?

Re: how to use picontrol?

Posted: 18 Jan 2020, 10:03
by huanghuapan
In other words, we know that the program BitMirror.py can implement Mirror DIO channel 1 input to DIO channel 1 output, now we want to implement mirror AIO channel 1 input to AIO channel 1 output, how to write this code?