用python进行硬件编程 [英] Programming with hardware in python

查看:469
本文介绍了用python进行硬件编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始对最近制作的小玩具进行编程感到无聊,我很想开始编程并与硬件交互.

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.

唯一的问题是,我主要是一个没有真正学习或使用任何其他语言的python专家.我仍然可以使用python与硬件进行交互吗?

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?

推荐答案

与PC上的串行端口进行交互非常简单,并且存在 Python串行库可用. roomba机器人可以通过串行端口进行控制.可能还有其他机器人,但这可能是使您前进的一个简单而小的步骤.

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.

个人而言,通过购买 PIC程序员,然后制作一些简单的闪光LED的电路.我继续通过串行端口控制这些PIC,后来又使用USB(通过 libusb )进行控制.有一个更大的学习曲线,因为您必须使用C或汇编器对PIC进行编程,但是一旦掌握了基础知识,就可以取得一些非常令人难以置信的结果.不过我警告您,一旦您意识到可以建造多少个酷小工具,这是一个湿滑的斜坡:-)

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

这篇关于用python进行硬件编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆