本文介绍了如何编写一个Arduino比标准C有什么不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在嵌入式系统编程背景(TI ,爱特梅尔的)。如何编程比那些不同的一个Arduino?我可以把关于C什么知识来编程Arduino的?

I have a background in programming embedded systems (TI MSP430, Atmel ATxmega). How is programming an Arduino different than those? What knowledge about C can I take in to programming the Arduino?

推荐答案

虽然我不知道有这个ATXMega呢,喜欢上了新Arduinos使用的ATmega328 8位AVR芯片使用AVR-GCC编译器。这允许编译C甚至C ++来的AVR芯片。在AVR-GCC的上一级是,C库,使编程的AVR更高层次的任务(不再需要参考寄存器直接,等等)。

While I don't know about the ATXMega, the 8-bit AVR chips like the ATmega328 used on the newer Arduinos use the AVR-GCC compiler. This allows for compiling C and even C++ to an AVR chip. One level above the AVR-GCC is the AVR Libc, a C library that makes programming for the AVR a higher level task (no longer have to refer to registers directly, and so on).

Arduino的IDE使用AVR-GCC和AVR libc库中的后端。此外,Arduino的IDE使得,像一个很好的串行接口

The Arduino IDE uses AVR-GCC and AVR libc library in the backend. In addition, the Arduino IDE makes other libraries available, like a nice Serial interface.

最后,Arduino的自带烧了AVR芯片上的引导程序。引导加载程序只是使人们有可能以AVR使用,而不是一个在系统正程序员或开发板的串行连接(通过USB)进行编程。

Finally, the Arduino comes with a bootloader burned on the AVR chip. The bootloader simply makes it possible to program the AVR using a serial connection (from USB) instead of an In-Sytem Programmer or Development Board.

够背景故事,来回答你的问题:Arduino的可以在C编程,甚至C ++。可用的库是用C写的,一切都将使用AVR-GCC编译。 Arduino的IDE甚至没有要求,我设置了一个来让你与Eclipse CDT和编程Arduino的。

Enough backstory, to answer your question: The Arduino can be programmed in C and even C++. The libraries available are written in C and everything will compiled using AVR-GCC. The Arduino IDE isn't even required, I set up a basic Eclipse project on GitHub to allow you to program the Arduino with Eclipse and CDT.

修改

有似乎是这个话题的兴趣像样的数目。我写了一篇博客文章,试图给出。

There seems to be a decent amount of interest in this topic. I wrote a blog post to try and give more in-depth details on the AVR, Arduino, and AVR-GCC.

这篇关于如何编写一个Arduino比标准C有什么不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 06:51