山姆的編程實作分享。。。

Sam Blog, Sam Sharing, Sam Studio

2019年3月1日

[Arduino 學堂 #11] ESP32 安裝及WiFi/BT測試



影片內容:
1. 把 Arduino UNO, MKR WiFi 1010 以及 ESP32 做一個超級比一比
2. 分享 ESP32 的 Arduino IDE package 安裝及設定步驟
3. ESP32 package URL    https://dl.espressif.com/dl/package_esp32_index.json
4. ESP8266 package URL  http://arduino.esp8266.com/stable/package_esp8266com_index.json
5. 教導如何透過Arduino WiFi Scan / BLE Scan 範例, 在收到ESP32板子的第一時間來驗證 ESP32 WiFi / Bluetooth 功能
以下為影片部分畫面:







[Arduino 學習筆記 #1] 軟體安裝及開發環境建構
[Arduino 學習筆記 #2] 葵花寶典導讀及IO實作
[Arduino 學習筆記 #3] Arduino 的屠龍刀 & 倚天劍
[Arduino 學習筆記 #4] 一窺 Arduino UNO 電路設計
[Arduino 學習筆記 #5] ADC的使用及電表程式教學
[Arduino 學習筆記 #6] Arduino Inside - Core Start-up & Initialization
[Arduino 學堂 #7] Debounce 及 外部中斷 (上)
[Arduino 學堂 #8] Debounce 及 外部中斷 (下)
[Arduino 學堂 #9] FreeRTOS is ready to Go!
[Arduino 學堂 #10] Fast PWM, Phase correct PWM 分清楚 ?
[Arduino 學堂 #11] ESP32 安裝及WiFi/BT測試
[Arduino 學堂 #12] 解放ESP32吧!
[Arduino 學堂 #13] Android / iOS App 開發平台/方式


2019年2月24日

[Arduino 學堂 #10] Fast, Phase correct PWM 分清楚 ?


教學內容:
1. 使用analogWrite() 函數撰寫LED 呼吸燈範例
2. 解說 Microchip ATmega328P PWM 運作原理
3. 說明 Arduino PWM default 設定 及 頻率設定
4. 說明 Fast PWM 和Phase correct PWM 的差異
5. 介紹其他chip vendor 更貼切的 PWM 命名
6. 說明 Phase correct PWM 和 Phase and Frequency correct PWM mode 的差異
以下為影片部分畫面:





2019年1月31日

[Arduino 學堂 #9] FreeRTOS is ready to Go!




教學內容: 1. 定義什麼是 RTOS 以及 RTOS 共通特性
2. 說明為何我要在Arduino 教學中導入RTOS
3. 說明為何我要選擇FreeRTOS
4. 分享我的參考網站
https://www.arduino.cc
http://www.aosabook.org/en/freertos.html
https://www.freertos.org/about-RTOS.html
http://www.keil.com/rl-arm/rtx_rtosadv.asp
5. 教導怎麼import FreeRTOS library
6. 建立第一個 Arduino multitask 的程式

以下為影片部分畫面:





2019年1月22日

[Arduino 學堂 #8] Debounce 及 外部中斷 (下)


教學內容: 1. 承續第7集的教學影片, 講解如何將程式從polling改成以中斷方式偵測按鍵的按壓
2. 講解中斷程式撰寫前的須知
a. 中斷腳位的定義及決定
b. 以INT0為例, 講解INT0中斷必須了解的3個暫存器
c. 講解中斷向量(Interrupt Verctor)及中斷服務常式(Interrupt Service Routine, ISR)定義及使用
3. 透過動態說明 Falling Edge, Rising Edge, Low level 及 Logical Change 觸發定義
4. 講解 ISR() 程式的撰寫
5. 透過 step by step 說明, 將程式改成以中斷方式來偵測按鍵的按壓
6. 分享完整程式碼 https://mega.nz/#!vmJHiYaa!sm0qHKLmySc5UdK19HnQWzRpIqxoeRietZx601SQ6Tk

以下為影片部分畫面:











[Arduino 學堂 #7] Debounce 及 外部中斷 (上)



教學內容: 1. 講解如何利用 digitalRead() 函數以polling 方式偵測按鍵的按壓
2. 透過動態說明按鍵彈跳(bounce)在電路上的波型
3. 講解如何透過程式的修改來解決按鍵彈跳問題, 也就是所謂的debounce
4. 分享完整程式碼 https://mega.nz/#!vmJHiYaa!sm0qHKLmySc5UdK19HnQWzRpIqxoeRietZx601SQ6Tk

以下影片部分畫面:




2018年12月10日

Error opening serial port - Permission denied


The temp solution is

In terminal to execute below command

sudo chmod 666 ttyACM0

after power on-off cycle, this problem still exists
PS: the 666 means r+w

The final solution is done by adding the currently logged user into dialout group with the following command:
sudo usermod -a -G dial $USER


2018年12月8日

2018年11月28日

2018年11月22日

2018年11月6日

熱門文章