how to use picontrol?

Topics about the Software of Revolution Pi
huanghuapan
Posts: 30
Joined: 03 Sep 2018, 10:01

how to use picontrol?

Post 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?
User avatar
nicolaiB
KUNBUS
Posts: 931
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: how to use picontrol?

Post 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
huanghuapan
Posts: 30
Joined: 03 Sep 2018, 10:01

Re: how to use picontrol?

Post 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 ?
User avatar
nicolaiB
KUNBUS
Posts: 931
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: how to use picontrol?

Post 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 ?
huanghuapan
Posts: 30
Joined: 03 Sep 2018, 10:01

Re: how to use picontrol?

Post 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?
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: how to use picontrol?

Post 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
huanghuapan
Posts: 30
Joined: 03 Sep 2018, 10:01

Re: how to use picontrol?

Post 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?
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: how to use picontrol?

Post by dirk »

Hi, here are some example scripts:
example scripts.zip
(1.35 KiB) Downloaded 897 times
huanghuapan
Posts: 30
Joined: 03 Sep 2018, 10:01

Re: how to use picontrol?

Post by huanghuapan »

Thank you,Dirk,These example scripts can use in AIO modules?
huanghuapan
Posts: 30
Joined: 03 Sep 2018, 10:01

Re: how to use picontrol?

Post 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?
Post Reply