Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programming with hardware in python [closed]

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?

like image 507
Josh Hunt Avatar asked May 28 '09 08:05

Josh Hunt


People also ask

Can we program hardware with Python?

Python is a programming language that lets you write code quickly and effectively. With a design philosophy that focuses on code readability, Python is easy to learn and use. Thanks to the advances in single board computers and powerful microcontrollers, Python can now be used to control hardware.

How does Python interact with hardware?

You can use ctypes for interfacing with hardware. It'll let you call into native libraries, so you can essentially use it to do anything that C can do. This is of course assuming that you want to interact with hardware via your host computer running Python.

What hardware is needed for Python?

System requirements for Python Installation: 1. Operating system: Linux- Ubuntu 16.04 to 17.10, or Windows 7 to 10, with 2GB RAM (4GB preferable) 2. You have to install Python 3.6 and related packages, please follow the installation instructions given below as per your operating system.


1 Answers

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 :-)

like image 130
Jon Cage Avatar answered Oct 17 '22 06:10

Jon Cage