Arduino 连接 Processing 通过 Firmata(for MAC)
2016-03-31 20:59
801 查看
来源:https://chennywublog.wordpress.com/2013/11/11/ardunio-processing-firmata-for-mac/ 非常感谢
arduino 与 processing 可以通过Firmata协议连接,然使用在MAC机时需要有一个地方特别注意。
先把Firmata 代码烧录进arduino板,然后使用processing测试以下代码
接著你會看到最下面的就是你所使用的Comport
由於有四個
依照陣列[0] [1] [2] [3]
所以你的Comport等一下要輸入3
以此類推
接下來
打開一個新的processing
輸入下面的code
如果是pc的话可以使用arduino = new Arduino(this, Arduino.list[0], 57600);获得端口
arduino 与 processing 可以通过Firmata协议连接,然使用在MAC机时需要有一个地方特别注意。
先把Firmata 代码烧录进arduino板,然后使用processing测试以下代码
import processing.serial.*; void setup(){ println(Serial.list()); }
接著你會看到最下面的就是你所使用的Comport
由於有四個
依照陣列[0] [1] [2] [3]
所以你的Comport等一下要輸入3
以此類推
接下來
打開一個新的processing
輸入下面的code
import processing.serial.*; import cc.arduino.*; Arduino arduino; void setup() { arduino = new Arduino(this, Arduino.list()[3], 57600); for (int i = 0; i <= 13; i++) arduino.pinMode(i, Arduino.INPUT); } void draw() { println(arduino.analogRead(0)); }
如果是pc的话可以使用arduino = new Arduino(this, Arduino.list[0], 57600);获得端口
相关文章推荐
- NGUI之添加响应函数
- 轻量级应用开发之(04)UIScrollView-1
- 苹果应用 Windows 申请 普通证书 和Push 证书 Hbuilder 个推
- Java_Hql_Query_Basic
- 循环语句中continue使用(JAVA)
- UESTC 1050 Different game 构造法
- Compile,Build/Link和Execute((编译、连接和运行))的联系与区别
- Burp Suite使用介绍(四)
- Burp Suite使用介绍(三)
- UIImageView圆角,自适应图片宽高比例,图片拉伸,缩放比例和图片缩微图
- UITableView使用指南(呕心原创)
- 使用CAShapeLayer与UIBezierPath画出想要的图形
- Burp suite与fuzzdb
- Burp Suite使用介绍(一)
- ob_flush()和flush()和ob_implicit_flush(true)
- warning: Error opening file (../../modules/highgui/src/cap_ffmpeg_impl.hpp:545)
- 在项目当中如何对UIButton进行重新布局
- javaGUI中 随机生成一组位置不同的按钮 并对JButton的左键、右键、双击的监听
- IOS开发之UIView总结
- easyui 点击文字展开和收缩节点