极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

楼主: peanut

Sublime Text 2的Arduino插件 ---- 替代Arduino IDE

[复制链接]
发表于 2013-1-2 18:34:14 | 显示全部楼层
peanut 发表于 2013-1-2 17:05
我近一段在研究装OSX的问题,还没成功,所以mac上的问题我一直不知道究竟如何。但是据Tony反映,可以在在 ...

哈哈如果你在北京的话我可以把我mac借你用。
[Errno 2] No such file or directory
[cmd:  [u'./build.sh']]
[dir:  /Users/wangwenbo000/Desktop/yaokongche/yaokongche_arduino]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
[Finished]
这是我command+b之后报的信息。
在我的文件路径下新建了build文件夹下生成了cpp
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-1-2 19:03:28 | 显示全部楼层
北京有点远,我还是自己鼓捣OSX吧。
你是用ST2的build,这个是不生成文件的。
你要用Arduino菜单的中编译,生成build.sh和makefile,分析源代码生成cpp,然后开始编译。
要是还不管用的话,继续跟帖。{:soso_e100:}
回复 支持 反对

使用道具 举报

发表于 2013-1-2 20:18:21 | 显示全部楼层
peanut 发表于 2013-1-2 19:03
北京有点远,我还是自己鼓捣OSX吧。
你是用ST2的build,这个是不生成文件的。
你要用Arduino菜单的中编译 ...

Writing file /Users/wangwenbo000/Desktop/hello/hello.ino with encoding UTF-8
Traceback (most recent call last):
  File "./sublime_plugin.py", line 339, in run_
  File "./run.py", line 288, in run
  File "./stino/utils.py", line 284, in runBuild
  File "./stino/utils.py", line 909, in genBuildFiles
  File "./stino/utils.py", line 97, in writeFile
UnicodeEncodeError: 'ascii' codec can't encode characters in position 155-156: ordinal not in range(128)
我出了这个问题,之前的帖子貌似也说过,不知道是为什么。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-1-2 20:56:42 来自手机 | 显示全部楼层
按道理不应该出现这个问题了。你把你这个hello.ino文件发给我看看。
回复 支持 反对

使用道具 举报

发表于 2013-1-2 21:52:05 | 显示全部楼层
peanut 发表于 2013-1-2 20:56
按道理不应该出现这个问题了。你把你这个hello.ino文件发给我看看。

我用了arduino菜单下调出了官方例子,也是不可以
Writing file /Applications/Arduino.app/Contents/Resources/Java/examples/01.Basics/Blink/Blink.ino with encoding UTF-8
Traceback (most recent call last):
  File "./sublime_plugin.py", line 339, in run_
  File "./run.py", line 300, in run
  File "./stino/utils.py", line 284, in runBuild
  File "./stino/utils.py", line 909, in genBuildFiles
  File "./stino/utils.py", line 97, in writeFile
UnicodeEncodeError: 'ascii' codec can't encode characters in position 155-156: ordinal not in range(128)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-1-2 22:02:27 | 显示全部楼层
ok, 我来想想。估计是python获得系统编码在osx下无效的问题。你是中文系统的话,系统编码不应该是ascii,你试试把系统设置成英文,编译出错不?若不出错,应该是osx的问题,这个我得装上osx之后才能找出解决方案。
回复 支持 反对

使用道具 举报

发表于 2013-1-2 22:20:45 | 显示全部楼层
peanut 发表于 2013-1-2 22:02
ok, 我来想想。估计是python获得系统编码在osx下无效的问题。你是中文系统的话,系统编码不应该是ascii,你 ...

我知道问题所在了,不用修改系统语言,是插件中文的问题。我将插件语言改成英文后,一切都正常了。
非常感谢。希望对你有帮助。终于可以不用官方的ide了,实在没感觉。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-1-2 22:23:35 | 显示全部楼层
本帖最后由 peanut 于 2013-1-2 23:38 编辑

我查了查,osx应该是用utf-8的,我过一会改改,将osx都改为utf-8,估计就没问题了。
回复 支持 反对

使用道具 举报

发表于 2013-1-2 22:30:02 | 显示全部楼层
peanut 发表于 2013-1-2 22:23
我查了查,osx应该是用utf-8的,我过一会改改,将osx都改为utf-8,估计就没问题了。
还有,为什么不能解码 ...

hello的那个文件也是一个闪灯的例子,我刚刚发现是不是我有自己安装的库就不能成功烧录。而且在arduino菜单下的add library下也出不来。另外我在mac下添加路径的时候需要找到.app文件下的java文件添加才能成功
Cleaning...
Building...
Creating ./build/yaokongche_arduino.cpp.o...
build/yaokongche_arduino.cpp:8: error: 'AF_DCMotor' does not name a type
build/yaokongche_arduino.cpp:9: error: 'AF_DCMotor' does not name a type
build/yaokongche_arduino.cpp:10: error: 'AF_DCMotor' does not name a type
build/yaokongche_arduino.cpp:11: error: 'AF_DCMotor' does not name a type
build/yaokongche_arduino.cpp: In function 'void setup()':
build/yaokongche_arduino.cpp:19: error: 'motor3' was not declared in this scope
build/yaokongche_arduino.cpp:20: error: 'motor4' was not declared in this scope
build/yaokongche_arduino.cpp:21: error: 'motor1' was not declared in this scope
build/yaokongche_arduino.cpp:22: error: 'motor2' was not declared in this scope
build/yaokongche_arduino.cpp: In function 'void loop()':
build/yaokongche_arduino.cpp:29: error: 'motor3' was not declared in this scope
build/yaokongche_arduino.cpp:29: error: 'FORWARD' was not declared in this scope
build/yaokongche_arduino.cpp:30: error: 'motor4' was not declared in this scope
build/yaokongche_arduino.cpp:31: error: 'motor1' was not declared in this scope
build/yaokongche_arduino.cpp:32: error: 'motor2' was not declared in this scope
build/yaokongche_arduino.cpp:37: error: 'motor3' was not declared in this scope
build/yaokongche_arduino.cpp:37: error: 'BACKWARD' was not declared in this scope
build/yaokongche_arduino.cpp:38: error: 'motor4' was not declared in this scope
build/yaokongche_arduino.cpp:39: error: 'motor1' was not declared in this scope
build/yaokongche_arduino.cpp:40: error: 'motor2' was not declared in this scope
build/yaokongche_arduino.cpp:44: error: 'motor3' was not declared in this scope
build/yaokongche_arduino.cpp:44: error: 'RELEASE' was not declared in this scope
build/yaokongche_arduino.cpp:45: error: 'motor4' was not declared in this scope
build/yaokongche_arduino.cpp:46: error: 'motor1' was not declared in this scope
build/yaokongche_arduino.cpp:47: error: 'motor2' was not declared in this scope
build/yaokongche_arduino.cpp:51: error: 'motor3' was not declared in this scope
build/yaokongche_arduino.cpp:51: error: 'FORWARD' was not declared in this scope
build/yaokongche_arduino.cpp:52: error: 'motor4' was not declared in this scope
build/yaokongche_arduino.cpp:52: error: 'BACKWARD' was not declared in this scope
build/yaokongche_arduino.cpp:53: error: 'motor1' was not declared in this scope
build/yaokongche_arduino.cpp:54: error: 'motor2' was not declared in this scope
build/yaokongche_arduino.cpp:58: error: 'motor3' was not declared in this scope
build/yaokongche_arduino.cpp:58: error: 'BACKWARD' was not declared in this scope
build/yaokongche_arduino.cpp:59: error: 'motor4' was not declared in this scope
build/yaokongche_arduino.cpp:59: error: 'FORWARD' was not declared in this scope
build/yaokongche_arduino.cpp:60: error: 'motor1' was not declared in this scope
build/yaokongche_arduino.cpp:61: error: 'motor2' was not declared in this scope
make: *** [build/yaokongche_arduino.cpp.o] Error 1
[Finished in 0.1s with exit code 2]
我的例子里面用了一块l293d的电机驱动板的库。上面是出错信息
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-1-2 23:56:25 | 显示全部楼层
我按照Arduino的逻辑,搜索Arduino和Sketchbook两个目录下的libraries目录,libraries目录下的目录即为库。如果你的库不是在这两个地方,就找不到。

你的这些错误,应该是没有#include头文件。变量和函数都没有声明。

OSX下的程序封装和Win及Linux下不一样,Win和Linux下都是直接Arduino目录,下面有Arduino可执行程序和lib、hardware等目录,所以我是以判断这个目录下的文件夹来判断是不是Arduino目录。OSX下的目录结构是Arduino.app/Contents/Resources/JAVA/,呵呵,多了一大截。苹果把程序目录伪装成一个应用程序,下面有复杂的结构,但是对用户来说比较简单。因为我基本没用过苹果,所以一直是按照Linux处理苹果的,但是苹果有很多自己的特殊地方。

你用的是master分支,我在前几天已经写了1.1分支,你可以在github下载。新的分支支持更多的Arduino版本;支持多个ino和pde文件;弃用了ST2的build系统,自己写了一个build面板来处理编译信息;还有就是单独处理了OSX的目录,选Arduino.app就行了,不用找JAVA了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-1-3 00:16:19 | 显示全部楼层
OSX的编码改为utf-8不变,用中文应该不会有问题了。
回复 支持 反对

使用道具 举报

发表于 2013-1-3 00:23:16 | 显示全部楼层
peanut 发表于 2013-1-2 23:56
我按照Arduino的逻辑,搜索Arduino和Sketchbook两个目录下的libraries目录,libraries目录下的目录即为库。 ...

新版本我试了,编译时不知道为什么就卡死了,mac七彩菊花就开始转,就没反映了。老版本没有问题了我改了下库的存放位置就好了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-1-3 00:50:12 | 显示全部楼层
呵呵,那先用master吧。等我自己测试过了再说。毕竟我在win7上写的,我有Linux可以测试,但是MAC始终是个问题。
回复 支持 反对

使用道具 举报

发表于 2013-1-3 01:25:03 | 显示全部楼层
peanut 发表于 2013-1-3 00:50
呵呵,那先用master吧。等我自己测试过了再说。毕竟我在win7上写的,我有Linux可以测试,但是MAC始终是个问 ...

非常感谢提供的插件。终于可以把很多工作都在一个编辑器里完成了,感觉一身轻松。{:2_31:}
回复 支持 反对

使用道具 举报

发表于 2013-4-26 13:43:56 | 显示全部楼层
{:soso_e179:} 厉害
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|联系我们|极客工坊

GMT+8, 2026-6-13 20:35 , Processed in 0.069434 second(s), 17 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表