c++ - 使用 C++ 上传草图

标签 c++ arduino

我想编译 sketch使用 Arduino IDE,然后找到 bin 文件并使用另一个程序上传它。

如何为 Arduino 设计自定义 uploader (规范等)?

最佳答案

您已经可以使用 avrdude 做到这一点。如果您绝对不需要开发另一个程序,请尝试使用此程序。

如果您绝对必须实现自己的编程器,请查看 stk500 协议(protocol)。

示例用法:

/usr/local/bin/avrdude -V -F -C /etc/avrdude.conf -p atmega328p -P /dev/ttyACM0 
    -c stk500v1 -b 57600 -U flash:w:applet/helloworld.hex

多平台教程:

这是一个依赖 avrdude 的类似程序(用 C# 编写):

命令行示例:

The following is the command that should be used for uploading a program to an Arduino Duemilanove (with an ATmega168 chip).

avrdude -c arduino -p m168 -P usb -U flash:w:FILENAME

replace FILENAME with the hex file you wish to upload to the board. This assumes that you want to write a file to the flash memory. You can of course verify or read from different portions of memory depending on your chip but I’ll leave you to figure that out from the AVRdude manual.

关于c++ - 使用 C++ 上传草图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12694302/

相关文章:

c++ - 防止在头文件之外创建子类

c++ - 创建具有基于字符串的类型的多态 C++ 对象的最佳方法?

c++ - 使用(连同)realloc 调用构造函数

c++ - 如何取消引用作为指针的链表节点数据?

python - 处理 Arduino-Python 通信中的异常

Arduino 独立版

c++ - 如何追踪使用过的DLL(是不是所谓的DLL hell ?)

serial-port - Arduino - 乱码串行输出

c++ - 自动收报机中断会干扰硬件中断吗?

Python:将 uint16_t 数组转换为字符串(通过 RS-485 从 Arduino)