More Related Content Similar to LinkIt 7697 IoT tutorial (20) More from CAVEDU Education (20) LinkIt 7697 IoT tutorial3. Product
Name
LinkIt 7697
Manufacturer Seeed Studio
Module wrtnode7 (wrtnode.com)
Chipset
MT7697
Cortex-M4 with FPU @
192Mhz
RAM 352 KB
Flash 4 MB
Wi-Fi 802.11 b/g/n (2.4G)
Bluetooth 4.2 LE
Dimension 48x26 mm
Operating Voltage 3v3
Input Voltage 5v (microUSB)
USB2UART CP2102N
Peripheral
Interfaces
GPIO x18
UART x2
I2C x1
SPI x1
PWM x18
EINT x4
ADC x4 (0~2.5V)
IrDA x1
I2S x1
Debug Interfaces SWD x1
LinkIt 7697
• 聯發科技最新的物聯網開發板
– Wi-Fi / BLE 雙通訊功能
– 採用主流 Cortex-M4 架構
– 開放的軟體開發環境 (FreeRTOS)
5. LinkIt 7697 開發板外觀介紹
Copyright © MediaTek Inc. All
rights reserved.
5
WrtNode7 無線模組內含:
• MediaTek MT7697 SoC
• 快閃記憶體
• 天線
重置按鈕
(RST)
使用者自定義按鈕
(P6)
UART0
傳輸燈號
(P0/P1)
供電指示燈
自定義燈
(P7) CP2102N UART 轉 USB 晶片
製造廠商:Silicon Labs
6. LinkIt 系列開發板比較
6
LinkIt ONE LinkIt Smart 7688/Duo LinkIt 7697
定位
all-in-one
IoT Dev Board
Rich IoT Endpoint
/ Gateway
Lightweight IoT Endpoint
發售年分 2014/7 2015/11 2017/4
微控制器
MT2502
(ARM7EJ-S)
MT7688
(MIPS)
MT7697
(ARM Cortex-M4F)
主頻 260Mhz 580Mhz 196Mhz
RAM 4MB 128MB 352K
Flash 16MB 32MB 3612K
Dev Platform Proprietary RTOS*1+ Arduino OpenWrt (Linux) + Arduino FreeRTOS + Arduino
Programming Lang C/C++ C/C++/JS/Python C/C++/JS/Visual
Wi-Fi 802.11 b/g/n 802.11 b/g/n 802.11 b/g/n
BLE BT 2.1/BLE 4.0 - BLE 4.2
Cellular GSM/GPRS*2 - -
GNSS GPS/GLONASS/BeiDou*2 - -
Ethernet - 10/100 PHY -
USB Device Host -
SD Card MicroSD MicroSD -
終端售價 ~2000 NTD ~500 NTD ~500 NTD
*1 沒有開源
*2 隨著台灣 2G 關台, GSM/GPRS 和 GNSS 的功能應用性就不高
8. Seeed 7697 Grove套件包
• Grove Breakout x1
• Grove - IMU 9DOF x1
• Grove – Temperature & Humidity
Sensor Pro x1
• Grove - Ultrasonic Ranger x1
• Grove - Relay x1
• Grove - OLED Display 0.96" x1
• Grove - Light Sensor x1
• Grove - LED Bar x1
• Grove – Servo x1
• Breadboard 82mm x 53mm x1
• Button x5
• 10K Ohm Rotary Potentiometer x1
• 1K/10k/330 Ohm Resistor x1
• RGB LED x1
• Red LED x5
• Micro USB Cable – 48 cm x1
• Breadboard Jumper Wire x25
10. Arduino IDE 下載
1. 請下載 Arduino 1.6.4 以後的版本
2. 從 board manager 安裝 7697 套件
3. 下載CP2102N驅動程式
11. 在Arduino IDE 偏好設定中貼上這個連結
• File / Preferences
• http://download.labs.mediatek.com/package_mtk_linkit_7697_index.json
• 旁邊的按鈕可以加入多個定義檔
14. 安裝 driver,請把 7697 接上電腦
• 下載CP2102N驅動程式,並根據您的作業
系統版本來安裝 x86/x64版本
• 安裝完畢之後請將7697接上電腦,就可自
動抓到它。
19. BlocklyDuino for LinkIt 7697的優點
19
• 可離線執行(github)
• 能產生對應的Arduino sketch ,便於學
習與除錯
• 與Arduino IDE結合,函式庫相容性與
擴充性高
• 可快速驗證想法可行性
• Open source
33. 您將在本例子使用的Block
33
•如果 < 事件 > 執行 < 事件
>
•< 資料 > 大於 < 資料
>
•< 數字
>
•賦值 < 資料型態 > < 變數 > 到 < 資料
>
•加入
Setup()
•延遲 < 資料
>
•寫入 Pin < 腳位 > 角度 < 資料
>
48. MCS 重要選項
• Console:主控台
• Development:
建立Prototype、新增修改Data
channel、查詢Data channel Id
• Test Devices:
查詢DeviceId、DeviceKey
• Resources:
教學文件、參考資料
• Resources:常見問題、論壇、回饋
55. 目前有哪些類型?
Controller
• ON/OFF
• Category
• Integer
• Float
• Hex
• String
• GPS
• GPIO
• PWM
• Analog
• GamePad
Display
• ON/OFF
• Category
• Integer
• Float
• Hex
• String
• GPS
• GPIO
• PWM
• Image Display
• Video Stream
66. MCS 控制 LED 閃爍
Arduino IDE 範例路徑:
File/examples/MCS/LED_Control
BlocklyDuino: MCS Blink
69. 更新Device Id/Key: #6,7,10
• #define _SSID "Maker_3F_A1"
• #define _KEY "25584819"
• MCSDevice mcs("DT95rNZa",
"QZg3IJdbXXC4uSgr");
70. Arduino程式說明: #16 17
• MCSControllerOnOff led(“LED_Control");
– 在此填入控制用的Channel id
• MCSDisplayOnOff remote(“LED");
– 在此填入顯示用的Channel id
紅字可修改,在此代表定義一個名為led的
MCS OnOff 控制器與名為remote的MCS
OnOff 顯示器
以上圖來說分別是LED_Control與LED
71. 連接channel id 與 mcs: #41 42
• mcs.addChannel(led);
• mcs.addChannel(remote);
72. 持續嘗試連上MCS : #43~47
• while(!mcs.connected())
• {
• Serial.println("MCS.connect()...");
• mcs.connect();
• }
73. 讀取來自MCS的數值: #51~55
• while(!led.valid()) //如果控制器有變化
• {
• Serial.println("read LED value from MCS...");
• led.value(); //取得MCS數值
• }
• Serial.print("done, LED value = ");
• Serial.println(led.value()); //顯示出來
81. 執行吧!
• 執行時可看到 MCS test device 名稱左邊亮
起綠燈,代表裝置已與 MCS 連通
• 拿起Android裝置打開 MCS app 來玩吧
109. 設定UUID: #16,17
• LBLEService ledService("19B10010-
E8F2-537E-4F6C-D104768A1214");
• LBLECharacteristicInt
switchCharacteristic("19B10011-E8F2-
537E-4F6C-D104768A1214",
LBLE_READ | LBLE_WRITE);
• 需與 App Inventor 端一致
112. 操作
• 請先上傳7697程式,並開啟 serial monitor
• 檢查一下 App Inventor 中有沒有修改 7697
的 BLE addr
• 先點選 [Connect] 按鈕,如看到
[connected]字樣 代表連線成功
• 點選 [ON] [OFF] 按鈕即可控制LED亮滅
• 點選 [Disconnect] 按鈕(同Connect) 斷線