Programming with hardware in python

Josh Hunt picture Josh Hunt · May 28, 2009 · Viewed 34.6k times · Source

I am starting to get a bit bored of programming little toys that I have been making recently, and I would love to starting programming and interacting with hardware.

The only problem is that I am mostly a python guy who hasn't really learned or used any other language. Can I still interact with hardware with python?

Also, what hardware can I interact with? I don't really have stuff lying around that I can use, so I would have to buy a kit or something. What are some cheap options for this?

Answer

Jon Cage picture Jon Cage · May 28, 2009

Interacting with the serial port on a PC is fairly trivial and there is Python Serial library available. The roomba robot is controllable via a serial port. There are probably other robots out there, but this might be a simple, smallish step to get you going.

Personally, I learned a lot by buying a PIC programmer and making some simple circuits to flash LEDs. I moved on to controlling those PICs via serial port and later using USB (via libusb). There's a bigger learning curve there as you'll have to program the PICs in C or assembler but you can achieve some pretty incredible results once you've picked up the basics. I warn you though, it's a slippery slope once you realise how many cool little gadgets you can build :-)