Arduino命令行编译 树莓派连接Arduino 电脑上编译Arduino代码后 通过树莓派烧写到Arduino上

//本教程针对UNO

1.在file->preferences中找到preferences.txt文件

2:用记事本打开preferences.txt,选择hex文件存放的路径,在最后行加入

build.path=D:ArduinoHex (换成你想要的目录)

3.安装Arduino 1.5.8

4.下载pscp.exe,plink.exe

5.复制如下代码到update.bat,按照本例就是D:Arduinoupdate.bat

注意点:(1)hexSwapFile所保存的那个文件夹要存在 (2)把下面的set里头的内容改成你自己的东西

set arduinoExeLocation="D:Program Files (x86)Arduinoarduino"
set username=pi
set password=somepassword
set ip=192.168.137.93
set hexSwapFile=/home/pi/Arduino/data.hex

%arduinoExeLocation% --upload %1
copy .hex*.cpp.hex data.hex
pscp -l "%username%" -pw "%password%" -r "data.hex" "%username%@%ip%:%hexSwapFile%"
plink -l "%username%" -pw "%password%" %ip% "avrdude -p m328p -c arduino -P /dev/ttyACM0 -b 115200 -U flash:w:%hexSwapFile%"

6.使用:在cmd中输入

D:Arduinoupload D:aa.uno (换成你的uno文件)

7.效果:

Arduino的图标会出现一阵子然后消失,之后等一会儿就成功了

//参考:http://aguegu.net/?p=1249

原文地址:https://www.cnblogs.com/turtlegood/p/4274519.html