I am looking for programming examples written in Ada (gnat) to access GPIO. I just started using a RPi3 with Raspbian, works fine. Then installed the gnat compiler and my first programs (simple tests with textual input/output via console) compile/link and execute fine. Now I want to access the GPIO. Any suggestions ? PS: Don't suggest to use another programming language :) I want to learn Ada and I have experience in programming in COBOL on BS2000, MS-Visual Basic on Windows, C on Solaris and Arduino, and some more...
1 Answer
I'll mention my pigpio library and daemon as the daemon was designed partly with other language use in mind.
You can manipulate the GPIOs from Ada by using the socket interface.
If you want a pure Ada interface have a look at http://abyz.me.uk/rpi/pigpio/examples.html#Misc_tiny_gpio which shows the sort of code you'll need to port to Ada.
-
1Hi joan. Just peeped into tiny_gpio.c and will run it on my Pi 3 soon. I hope to start translating to ADA next week (and adapt hardware revision). My Pi is a hobby project :) Thanks for the swift response to my question. Commented Jun 26, 2016 at 9:00
-
Hello, @Joan Can your library handle the Onion Omega2 ? See here for GPIO. If not, can I use the socket interface? I m new to this stuff :-/– MawgCommented Jan 11, 2019 at 12:15
-
Hmm, it seems like it has an Arduino hat, so no doubt soon also a Pi hat. But I would still prefer not to use a hat (shield) if possible– MawgCommented Jan 14, 2019 at 15:15