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...

  • 2
    FYI: I have no experience with ADA, except from the usual helloworld and some basic console and file IO test programs.
    – jmlietaer
    Commented Jun 26, 2016 at 9:06

1 Answer 1


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.

  • 1
    Hi 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.
    – jmlietaer
    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 :-/
    – Mawg
    Commented 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
    – Mawg
    Commented Jan 14, 2019 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.