Getting Started with Noduino on Mac OS X

来自Jack's Lab
(版本间的差异)
跳转到: 导航, 搜索
(选择串行端口)
(选择串行端口)
第97行: 第97行:
 
== 选择串行端口 ==
 
== 选择串行端口 ==
  
从“工具|串口”菜单中选择开发板的串口设备,由前面设备驱动安装后,设备管理器 (Device Manager) 显示可知,开发板的串口为 COM6
+
从“工具|串口”菜单中选择开发板的串口设备,由前面设备驱动安装后,开发板的串口为 /dev/cu.SLAB_USBtoUART
  
 
[[文件:Noduino-ide-com-osx.png]]
 
[[文件:Noduino-ide-com-osx.png]]
第107行: 第107行:
 
* CPU Frequency: "80 MHz"
 
* CPU Frequency: "80 MHz"
 
* Upload Speed: "115200"
 
* Upload Speed: "115200"
* Port: "COM6"
+
* Port: "/dev/cu.SLAB_USBtoUART"
  
 
<br><br>
 
<br><br>

2015年11月9日 (一) 12:01的版本

目录

1 准备开发板和USB连接线

准备一块 nodemcu v1.0 开发板,一根 micro USB 连接线:

Nodemcu-v1.0-board.jpg



2 下载Arduino软件

Arduino 软件开发环境是一个压缩包,下载解压后直接运行,即可使用。定制的版本位于:


百度云:http://pan.baidu.com/s/1qWkVJgo

微盘:http://vdisk.weibo.com/s/dn5OZrwbJHDa


下载 noduino-1.6.6-osx.tar.xz 留意一下用 md5sum 对压缩包进行完整性检查:




解压 noduino-1.6.6-osx.tar.xz



3 连接开发板

Micro USB 线的 microUSB 口连接 nodemcu 开发板,USB 口接 PC 的 USB 口。

开发板从 USB 口取电,开发板带 USB 转串口功能

PC 可通过这个 USB 线与开发板交换数据



4 安装驱动程序

开发板使用 CP2102 这颗 USB 转串口芯片,到芯片厂家官网下载 Mac OS X 版的驱动:http://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx

下载后安装,插上开发板,就能发现:

$ sudo dmesg|tail -n 27
hfs: unmount initiated on Recovery HD on device disk0s3
USB (XHCI Root Hub USB 2.0 Simulation):Port 1 on bus 0xa connected or disconnected: portSC(0xe0206e1)
com_silabs_driver_CP210xVCPDriver: init
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::attach
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::probe
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::detach
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::attach
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::start - Registered for Power Management
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::start!
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::start - Found device at interface 0
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::setPowerState - Waking up
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::SelectInterfaces - BulkInput Pipe is 0xffffff8031e15480 on EP1
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::SelectInterfaces - BulkOutput Pipe is 0xffffff802bac6900 on EP1
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo - Part Number Found: 0x02
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo - UsbConfigurationDescriptor - 
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo     .bLength = 9 
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo     .bDescriptorType = 0x02 
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo     .wTotalLength = 32 
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo     .bNumInterfaces = 1 
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo     .bConfigurationValue = 1 
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo     .iConfiguration = 0 
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo     .bmAttributes = 0x80 
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::GetCP210xInfo     .MaxPower = 50 
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::start - Sucessfully loaded the driver
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::message
com_silabs_driver_CP210xVCPDriver(0xffffff8039194000)::message
com_silabs_driver_CP210xVCPDriver::setPowerState(0x193cbab37128ae0d, 0 -> 1) timed out after 10205 ms



5 启动Arduino软件

Finder 里,双击解压后 arduino-1.6.6 即可运行 Arduino:

Noduino-run-mac.png


Noduino-ide-osx.png



6 选择开发板

Noduino-ide-board-osx.png



7 选择串行端口

从“工具|串口”菜单中选择开发板的串口设备,由前面设备驱动安装后,开发板的串口为 /dev/cu.SLAB_USBtoUART

Noduino-ide-com-osx.png


至此板级相关的参数为:

  • Board: "NodeMCU 1.0 (ESP-12E Module)"
  • CPU Frequency: "80 MHz"
  • Upload Speed: "115200"
  • Port: "/dev/cu.SLAB_USBtoUART"



8 打开闪烁示例

Noduino-ide-blink-osx.png



9 上传程序

在 Arduino IDE 中点击“上传”(Upload) 按钮。稍等片刻,你就会看到板子上模块的蓝色 LED 灯在快闪。

Noduino-ide-uploadbutton.png


如果上传成功,状态栏会出现“上传成功”(Done uploading) 的字样

Noduino-ide-upload-osx.png


上传完之后,你会很快看到板子靠近 USB 口的 LED 开始在慢闪(大概 1s 间隔),证明上传成功,你已经把 Noduino IDE 跑起来了!

























个人工具
名字空间

变换
操作
导航
工具箱