本文介绍了有没有一种办法"编译" Python的code到一个Arduino(宇野)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有与一个机器人类型的项目,并作出长话短说,我与试验一些AI算法。但是,我需要实现一些高层次的矩阵算法是使用 /的,但他们在C或C的绝对噩梦++。即使在图书馆外面,这是刚开荒谬的。

I have a robotics type project with an Arduino Uno, and to make a long story short, I am experimenting with some AI algorithms. However, I need to implement some high level matrix algorithms that would be quite simple using NumPy/SciPy, but they are an utter nightmare in C or C++. Even with the libraries out there, this is just getting ridiculous.

有没有什么办法可以做到在Python这个项目?我想我听说过一些有这个能力,但我有一个乌诺和替换它不是一个选项这一点(这将设置项目回了不少。)另外,我听说过使用Python通过USB接口进行通信到Arduino出头,但我不能有USB电缆,而事情正在运行。我需要能够上传程序,并用它来完成。

Is there any way I can do this project in Python? I think I heard something about the Mega having this capability, but I have an Uno, and replacing it is not an option at this point (that would set the project back quite a bit.) Also, I heard somethings about using Python to communicate to the Arduino via USB, but I cannot have the USB cable in while the thing is running. I need to be able to upload the program and be done with it.

是否有任何选择了那里,还是有我刚刚进入死胡同?

Are there any options out there, or have I just reached a dead end?

推荐答案

有一个谈这几年用Python与机器人称为通过跨格雷姆博士。

There was a talk about using Python with robotics at this years PyConAU called Ah! I see you have the machine that goes 'BING'! by Dr. Graeme Cross.

他建议在微控制器板上使用Python唯一的选择是我认为也是由名云。

The only option he recommended for using Python on a microcontroller board was PyMite which I think also goes by the name of Python-On-A-Chip.

它已经被移植到了一系列板 - 特别是他提到Arduino的超级你说这是不是一个选择,但它有可能是支持其他的Arduino板

It has been ported to a range of boards - specifically he mentions the Arduino Mega which you said is not an option for you, but it is possible it is supported on other Arduino boards.

但是,因为它是一个Python的不包括电池的版本就非常有可能,你将有一个真正的问题越来越多numpy的/ SciPy的等启动和运行。

However, because it is a "batteries not included" version of Python it is more than likely that you will have a real problem getting numpy/scipy etc up and running.

由于其他海报建议,在C实现可能是阻力最小的路径。

As other posters have suggested, implementing in C might be the path of least resistence.

更新:的再次,不是专门针对Arduino的,但看起来就提供蟒蛇芯片。提交人指出,他可以看,如果有足够的兴趣发展pyMCU的一个Arduino版本。

Update: again, not specifically for Arduino, but pyMCU looks to provide python on a chip. The author states he may look at developing an Arduino version of pyMCU if there is enough interest.

这篇关于有没有一种办法"编译" Python的code到一个Arduino(宇野)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 22:55