User avatar
Posts: 12
Joined: Thu Jun 02, 2016 4:43 pm

Re: C vs Python for GPIO

Mon Nov 26, 2018 1:49 am

Thanks for your reply.

Posts: 5780
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: C vs Python for GPIO

Mon Nov 26, 2018 8:48 am

Most such libraries for other languages are actually written in C ....

Posts: 15986
Joined: Tue Jul 17, 2012 3:02 pm

Re: C vs Python for GPIO

Mon Nov 26, 2018 11:31 am

The modern way to get your program running automatically at start up is to let systemd do it. You just have to write a short, simple "service" description file for it. See my description and example here: viewtopic.php?t=138861#p921354

As for the choice of Python vs C I'm pretty sure there is much support for the hardware on the Pi in C as there is in Python. With the added bonus that you don't even need any library to use GPIO and stuff in C, just go straight to the registers as any self-respecting embedded system guy would.

Perhaps there are manufacturers of HATs and such that are shipping only Python support. If that is important to you.

The important criteria is performance, if you feel the need for speed you will need C.

Personally I like to keep things simple so I prefer to use Javascript under node.js.
Memory in C++ is a leaky abstraction .

Return to “C/C++”