[fpc-pascal] GPIO for pi

Koenraad Lelong fpascal1 at de-brouwerij.be
Thu Jul 28 09:12:53 CEST 2016


Op 28-07-16 om 00:59 schreef Bo Berglund:
> On Wed, 27 Jul 2016 21:43:10 +0200, Bo Berglund
> <bo.berglund at gmail.com> wrote:
>

>
> Now done updating Raspbian to latest version.
> And the project compiles!
>
> If it works is another story because I do not understand what to do
> with a form with a long list of checkboxes without explanation...
>
>
The program is a demo/test program. It's the gui-fied version of 
x_pigpiod_if2.c.
Remove any IO from the pi, and then just press the Test-button.
The program then tests all functions (tests a through c are not 
implemented yet, because I don't have the extra hardware, like SPI or 
I2C devices). All tests should display 'PASS', there are sub-tests.
Output is like this :
Connected to pigpio daemon 0
Testing pigpiod C I/F 2
pigpio version 54
Hardware revision 10489921
Mode/PUD/read/write tests
TEST 1.1 PASS (set mode, get mode: 0)
TEST 1.2 PASS (set pull up down, read: 1)
TEST 1.3 PASS (set pull up down, read: 0)
TEST 1.4 PASS (write, get mode: 1)
TEST 1.5 PASS (read: 0)
TEST 1.6 PASS (write, read: 1)
PWM dutycycle/range/frequency tests.
...

Remember to program the IP-address of your pi at the start of the 
Test-button OnClick event, in the parameters of the pigpio_start call. 
That has to be the x.x.x.x form. 127.0.0.1 should work if you run the 
application on the pi itself.

The c-version uses pigpio_start(0, 0) where those 0's mean 'default 
values', which are ip-address 127.0.0.1 and port 8888.
I tried to replace those by
  pigpio_start(PChar(#0), PChar(#0)) or
  pigpio_start(PChar(''), PChar(''))
Both didn't work, so I hardcoded these values.

I'll ammend the application so users should input the address and port 
on the form, and give a warning to remove any IO from the pi.

Koenraad



More information about the fpc-pascal mailing list