4

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
    FYI: I have no experience with ADA, except from the usual helloworld and some basic console and file IO test programs. – jmlietaer Jun 26 '16 at 9:06
2

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 Jun 26 '16 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 Jan 11 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 Jan 14 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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