Friday, 14 October 2016

Finally......Code C on Raspberry Pi (book)

Well, you could have done this previously (of course), but is is sooooooo nice to see that this has become more mainstream.

If, like me, you have played around with Arduino (for many many years!), then you most likely were coding in C.  Then the Raspberry Pi came out and everyone was excited, yay! it was a mini-Linux 'puter that could do stuff with GPIO pins (or not), but a vast majority of the code you found was for Python.

Begrudgingly, I did actually use some Python to control my Maplin robotic arm from a web page, which worked and the code did make sense.  But, and this is a big BUT, I don't know, maybe I'm old skool, I just didn't LIKE coding in Python.  It felt like Perl (now who remembers that nightmare from the early 2000s!!!), it allowed you to do a lot of stuff and you could hack stuff together, but come back in 6 months time and you were none the wiser.  Don't even think about picking up code from someone else!

Anyway, I digress, through a series of events, I ended up with a Fujitsu Lifebook (small tablet computer) that is running Point Linux and I could code C on it.  Cool stuff.  So, (as you do), I wrote my own "naughty" version of PING.  You know the one, it's the first thing you type at a prompt when your web browser says, "No Connection".  Well, I wrote the C code for doing what Ping does, but I decided to "cough cough" 'extend' it a little, so that it does a full port scan/probe of the destination IP address.  Cool little tool to have btw.

Damn it, I digressed again...oh wait, back to the original thread.  Okay, so whilst I have been basking in the C programming glory for a while, I was thinking to myself, I have (too many) Raspberry Pis sitting on my "Play desk" waiting for me to do something funky with them, why am I not getting on with doing something?..... and the penny dropped.  Whilst I can do some funky stuff with Node-Red (IoT related things), I should really be doing more lower level stuff.... and I really still do not revel in having to use Python.  I don't know, maybe it just reminds me of PHP or something (ask Dion!).

Then yesterday I received an email with this image:
Ohhhh!!! then I thought about it a little more and then I realised, you've been able to code in C on a Pi for ages, in fact I think I even did do so about a year ago, but I got distracted by my day job (funny that) and it slipped my mind.


(Okay, the link to download the PDF, is kinda, not obvious, "look to the right....and look for the word 'FREE'")

It's a great refresher for all those people (over a certain age), who "got into IT" back when you learnt to code in C.  Guess what? you can again, my friend.  Go relive some fond memories, but more importantly, go and do some NEW things that the Raspberry Pi offers you too, plus get it doing stuff with the Cloud.

Seriously, this weekend, get the book, dust off the Pi that you've had connected to a web-cam for the past year (doing nothing) and "make a thing", there are so many things you can do now.
Impress your friends, okay maybe not.
Impress your children, okay maybe not.
Impress your wife....okay, I'm going too far now.

Talking of wife, my missus saw me looking at this and her first comment was, "I hope you use pointers properly this time".   I love my missus :-D

psttt... go do some C coding....... now!

No comments:

Post a Comment