arduino linux版本安装使用

来源:互联网 发布:优酷会员淘宝登录不了 编辑:程序博客网 时间:2024/05/29 14:00

较新的版本是1.0.5。但为了研究之前的开源代码,pde格式项目文件,只能从0023版本开始搞。

安装过程见:http://playground.arduino.cc/Linux/Ubuntu

sudo apt-get install gcc-avr avr-libc

或参考:http://www.pluggy.me.uk/arduino-ubuntu/

然后下载需要的版本包,解压后直接运行 ./arduion即可打开ide。


遇到的问题:

1.  arduino0023 for ubuntu版本里,tutorials工程就有编译错误。

现象及解决办法:

参考:https://groups.google.com/forum/#!topic/linux.debian.bugs.dist/9E6wE0b5wiw

In file included from /usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h:44:0,
                 from /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/delay.h:37,
                 from /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h:30,
                 from /usr/share/arduino/hardware/arduino/cores/arduino/WInterrupts.c:34:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/math.h:426:15: error: expected identifier or ‘(’ before ‘double’
/usr/lib/gcc/avr/4.5.3/../../../avr/include/math.h:426:15: error: expected ‘)’ before ‘>=’ token

which is caused by the macro definition of round() in wiring.h:
#define round(x)     ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))

commenting out this line fixes this final compliation error and the program compiles, uploads and correctly works on the Arduino that I have.

2. arduino0023及1.0.5版本,编译成功后无法选择对应的ttyACM0端口。因为Serial菜单是灰色的。

解决办法: sudo  ./arduino

此问题与putty中经常遇到的无法打开串口问题是类似的。解决办法是sudo putty即可。

如果/dev/ttyUSB0或/dev/ttyACM0仍然无打开权限。有一个办法就是chmod 777 /dev/ttyUSB0 这样就好了。



0 0
原创粉丝点击