历史上的今天
今天是:2024年12月06日(星期五)
2019年12月06日 | 使用eclipse Arduino IDE开发 AVR程序
2019-12-06 来源:eefocus
小白写程序都是用eclipse的,所以学习Arduino时自然就想用eclipse,因为俺懒,这样省事。网上找了些帖子看看,感觉开发环境都比较麻烦,这样不符合俺这种懒人的风格,所以我弄了个简单点的。
第一步:下载各种东西
1、JDK,这个去oracle官网下就好了(其实百度下载更快)http://download.oracle.com/otn-pub/java/jdk/8u20-b26/jdk-8u20-windows-x64.exe。
2、eclipseArduinoIDE,http://eclipse.baeyens.it/download.php
3、arduino-1.5.6-r2http://www.arduino.cc/en/Main/OldSoftwareReleases,eclipseArduinoIDE要这个版本,现在最新是1.58了,我没试好不好用。
第二步:安装配置
1、装完eclipseArduinoIDE,打开菜单Window>References设置Arduino项,Arduino IDE path指向arduino-1.5.6-r2安装目录,Arduino Librarie path指向arduino-1.5.6-r2的libraries 目录 ,Arduino hardware path指向arduino-1.5.6-r2的hardware 目录 。
做完这个设置保存是系统会提醒你去http://eclipse.baeyens.it/installAdvice.shtml看配置文档。
2、实际上配置文档里最主要的是要运行下下面的脚本。
@ECHO OFF
:: Recommended usage and things that can go wrong ...
::
:: This batch file does not tollerate spaces or any other strange characters in the path names.
::
:: Recommended usage scenario would be to copy the [arduino_IDE_install_directory]/hardware/arduino directory
:: to a temporary directory that you created at the root of a drive ... something like C:_temp will do but feel
:: free to call it what ever you want as long as there are no spaces or special characters in it. This ensures
:: there will not be any spaces in any of the path names and also keeps the original files until you are sure
:: the 1200+ files that will be changed are 'right' before you overwrite the originals.
::
:: Now that you have C:_temparduino, put this file in the directory. Make sure the extension is .bat as it may have
:: been changed to something else to allow it to pass thru spam and virus scanning software.
::
:: Run the batch file. It will take a while as it is modifying 1200+ files. If you want to see exactly what it is
:: doing comment out the '@ECHO OFF' ... ':: @ECHO OFF' ... before you execute the batch file.
::
:: After running the batch file and ensuring you are satisfied with the results replace the contents of the
:: [arduino_IDE_install_directory]/hardware/arduino directory with the contents of the C:_temparduino directory.
::
:: This batch file does not provide any safeguards related to you doing the wrong thing ... i.e. running it a second time
:: on previously patched files, etc. ... so Stop, Pause, Think is your best course of action.
::
SET temporaryFile=%CD%temporary_%RANDOM%.txt
SET appendFile=%CD%textToAppend_%RANDOM%.txt
SET prependFile=%CD%textToPrepend_%RANDOM%.txt
ECHO #endif>%appendFile%
SET architecture=AVR
ECHO #ifdef ARDUINO_ARCH_%architecture%>%prependFile%
ECHO #endif /* ARDUINO_ARCH_%architecture% */>%appendFile%
PUSHD %architecture%
FOR /F "usebackq delims=*" %%i IN (`dir /b /s *.cpp /s *.h /s *.c`) DO TYPE %prependFile%>%temporaryFile% & TYPE %%i>>%temporaryFile% & TYPE %appendFile%>>%temporaryFile% & MOVE /Y %temporaryFile% %%i
POPD
SET architecture=SAM
ECHO #ifdef ARDUINO_ARCH_%architecture%>%prependFile%
ECHO #endif /* ARDUINO_ARCH_%architecture% */>%appendFile%
PUSHD %architecture%
FOR /F "usebackq delims=*" %%i IN (`dir /b /s *.cpp /s *.h /s *.c`) DO TYPE %prependFile%>%temporaryFile% & TYPE %%i>>%temporaryFile% & TYPE %appendFile%>>%temporaryFile% & MOVE /Y %temporaryFile% %%i
POPD
DEL /F /Q %appendFile%
DEL /F /Q %prependFile%
把上面的代码复制下来,存成.bat文件,然后放到arduino-1.5.6-r2libraries目录下运行一下就ok了。
3、在菜单Window>References的C/C++项下面的File Types里面新建两项:*.ino 和*.pde,不建这两项的话没法编译。
第三步:新建项目
File-->new-->new Arduino sketch:
Boards.txt file选项里有avr和sam的两种,我用的nano,所以选avr的。
史海拾趣
|
项目要求用NI公司的LabWindows/CVI开发一个应用软件,在ARM9平台上运行,ARM开发版是SBC-2410X,操作系统为WinCE.想问一下用CVI开发出来的软件能不能在该平台上运行.我知道ARM9有很多家公司生产,CVI开发出来的软件在所有ARM9上都能 ...… 查看全部问答> |
|
模电书上说在负反馈放大电路中,输入信号为零时,因为某种电扰动(如合闸通电),其中含有频率为f0的信号,使得AF的附加相移达到180°或-180°,@负反馈变成了正反馈,如果|AF|>1,则产生了自激振荡。我不明白的是,如果@处条件不成立,也就是不存 ...… 查看全部问答> |
|
各位工程师大家好,哪位有有开2.4G防丢器的经验吗?本人从事无线通讯业务。目前遇到项目需要开发,想找些合适的工程人才开发,2.4G防丢器项目。在深圳打工永远都是没有保障的,业余的时候应该考虑下自己的事业。如果您时间充裕的话,请与我联络,让 ...… 查看全部问答> |
|
DLP Pico 投影技术是引领未来便携投影的技术,DLP 技术因投影创新而闻名。DLP Pico 芯片组是 DLP 引领投影技术的最新设计。这种令人惊叹的微型投影技术被应用于所有新型的超便携式 DLP Pico 投影仪。想象有一种便携式投影仪可以放在手掌中或成为手 ...… 查看全部问答> |
|
岗位职责 1、从事硬件技术的研究、设计、开发、调试、集成、维护和管理; 2、参与硬件产品项目规划工作,制定具体项目实施方案; 3、整合并优化项目开发所需各种资源; 4、为客户提供完善的硬件解决方案; 任职要求: 1、电子、计算机专业本科 ...… 查看全部问答> |




