Hello,
i've installed wiringPi and RTB (Return To Basic) in order to test GPIO. That works even as a pi user (I can on/off gpio pins).
Then i decided to try it with Lazarus. So downloaded lazwirinpi from there
http://forum.lazarus.freepascal.org/index.php/topic,17404.0.html. Afetr unpacking i compiled: gcc -c wiringPi.c. In Lazarus->Project Options->Paths->Library set new path to this folder (lazwiringpi) and the same with path to units.
Then i wrote simple code in command line program:
<code>
program test1;
uses hwiringPi;
begin
if wiringPiSetup<>-1 then
begin
pinMode(P11, 1); // instead of P11 I tried 0 too
digitalWrite(P11,1); // instead of P11 I tried 0 too
end
else
Writeln('Some error. ');
</code>
Try to run in shell as a pi user and get the error "/dev/mem acces denied". Ok. Try as a root.
Now didn't get error with "acces denied", but nothing has happened. I expected at least diode (P11 or 0) "on".
Why I can do it with RTB? Maybe lazwiringPi is not right library in this case, maybe should I look for wiringPi library installed with RTB?
I have no idea what to do..
Some help?
Martin