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

//本教程针对UNO

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

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

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

3.安装Arduino 1.5.8

4.下载pscp.exe,plink.exe

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

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

set arduinoExeLocation="D:\Program Files (x86)\Arduino\arduino"
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:\Arduino\upload D:\a\a.uno (换成你的uno文件)

7.效果:

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

 

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

转载于:https://www.cnblogs.com/turtlegood/p/4274519.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值