發表文章

目前顯示的是有「Arduino」標籤的文章

[第26期]使用ChatGPT在Arduino實現觀察者模式的程式碼/Use ChatGPT to implement Observer Pattern code in Arduino

圖片
This video shows how to use ChatGPT to implement Observer Pattern code in Arduino. The content includes: 1. Install C++ STL for Arduino 2. Use ChatGPT to implement Observer Pattern C++code with Arduino 3. Verify the generated code in Arduino IDE 本視頻在說明如何使用ChatGPT在Arduino中實現觀察者模式的程式碼。 內容如下 1. 安裝Arduino的C++標準函式庫 2. 使用ChatGPT實現觀察者模式的Arduino C++程式碼 3. 使用Arduino IDE驗證程式碼是否可執行

[第14期] Use VS Code and PlatformIO to debug ESP IDF code in the ESP Wrover Kit with internal JTAG

圖片
 This Video shows how to use VS Code and PlatformIO to debug ESP IDF code in the ESP Wrover Kit with internal JTAG. 1. Import project examples 2. Setup PlatformIO (Add new board)              3. Build project and Debug  ESP IDF Code   本影片說明如何使用VS Code and PlatformIO來偵錯ESP IDF程式在有內建JTAG的ESP Wrover Ki開發版上。 1. 輸入專案範例 2. 設定PlatformIO (增加新開發板) 5. 建置與偵錯Arduino程式

[第13期]Use VS Code and PlatformIO to debug Arduino code in the ESP Wrover Kit with internal JTAG

圖片
  This Video shows how to use VS Code and PlatformIO to debug Arduino code in the ESP Wrover Kit with internal JTAG. 1. Introduce PlatformIO 2. Introduce how to setup JTAG on ESP Wrover Kit and install JTAG Driver 3. Install PlatformIO extension 4. Setup PlatformIO 5. Create new project and Debug Arduino Code 本影片說明如何使用VS Code and PlatformIO來偵錯Arduino程式在有內建JTAG的ESP Wrover Ki開發版上。 1. PlatformIO簡介 2. 介紹如何設定與安裝JTAG驅動程式 3. 安裝PlatformIO擴充 4. 設定PlatformIO 5. 建立與偵錯Arduino程式

[FreeRTOS][Arduino] Data transmission between tasks by using queue/使用佇列來傳遞任務間的資料

圖片
This example shows how to use the queue to transmit data from one task to another task. 這個範例說明如何使用佇列將資料從一個任務傳到另一個任務。 We will introduce some queue related functions which used in this example: 我們將介紹一些跟佇列相關的函數: *   QueueCreate() -->Create the queue 創建佇列 *   xQueueSend() -->Send data to the queue 傳送資料到佇列中 *   xQueueReceive() -->Receive data from the queue 從資料中獲取佇列 *   taskYIELD() -->Switch to another task 轉換到其他任務 *   uxQueueMessagesWaiting()--> find how many data in the queue 發現佇列中有多少資料數 Media 影音: Other articles related to FreeRTOS: 其他與FreeRTOS相關的文章: 1.  [Arduino]Install FreeRTOS in Arduino/在Arduino中安裝FreeRTOS 2. [FreeRTOS][Arduino]Create FreeRTOS task in Arduino with VS Code/使用VS code在Arduino中創建任務 3. [FreeRTOS]Use vTaskDelay to implement tasks running in different priorities/使用延時函數實現不同優先順序的任務執行

[贊助區] MPU6050六軸感測器利用連芽模組HC06與Android App傳遞訊息

圖片
本篇是將MPU6050六軸感測器利用Bluetooth(HC-06)與Android App傳遞訊息, 這一個範例傳的是MPU6050的Yaw, Pitch, Roll數值,使用Arduino mega 2560做資料擷取,Android App是用App Inventor開發。 此範例花了許多時間在解決藍牙傳輸浮點數(floating point)數據到Android手機端後, App Inventor如何處理浮點數數據並顯示出來。   贊助本篇的人,將會得到: 1. Arduino程式碼 2. App Inventor 2藍牙相關的程式碼 3. 程式碼使用教學影片   > MPU6050的相關影片 1.  [Arduino] Acquisition of MPU6050 raw data by using Mega2560/使用Mega2560擷取MPU6050原始資料   2.  [Arduino] Acquisition of MPU6050 raw data by using Mega2560/使用Mega2560擷取MPU6050原始資料   3.  [Arduino]Transmit ypr data of MPU6050 to App vis HC06/將MPU6050的ypr的資料經由HC06傳輸到手機App上

[Arduino] Acquisition of MPU6050 raw data by using Mega2560/使用Mega2560擷取MPU6050原始資料

圖片
This example shows how read the raw data of MPU6050 by using Arduino Mega2560. There are several steps: 1. Download and install MPU6050 library. (refer to:  http://www.i2cdevlib.com/devices/mpu6050#source ) 2. Introduce the source code. 3. Connect MPU6050 to Mega2560. (refer to:  https://fishark.pixnet.net/blog/post/42021475 ) 4. Print raw data (ax, ay, az, gx, gy, gz) to the serial port monitor. 這個範例說明如何使用Mega2560來讀取MPU6050的原始資料。 步驟如下: 1. 下載與安裝MPU6050函式庫。(參考:  http://www.i2cdevlib.com/devices/mpu6050#source ) 2.  程式碼簡介。 3. 連接MPU6050 與Mega2560。 (參考:  https://fishark.pixnet.net/blog/post/42021475 ) 4. 列印原始資料 (x, y, z的加速度與角加速度)到序列埠監控視窗。

[Arduino][FreeRTOS]Use vTaskDelay to implement tasks running in different priorities/使用延時函數實現不同優先順序的任務執行

圖片
This example explain what are tick, tick ISR, task states (Running, Ready, Blocked, and Suspended) and how to use two task delay functions (vTaskDelay and vTaskDelayUntil) to elimanate starving state while two tasks are called with different priorities . 這個範例說明什麼是時脈、時脈中斷服務、任務狀態(執行、就緒、阻塞與掛起),以及如何使用任務延時的函數(相對延時vTaskDelay與 絕對延時vTaskDelayUntil)去消除呼叫兩個不同優先順序的任務時產生的餓死狀態。 Hardware: Arduino Mega2560 Software: VS Code

[FreeRTOS][Arduino]Create FreeRTOS task in Arduino with VS Code/使用VS code在Arduino中創建任務

圖片
  This example shows how to create FreeRTOS task, call scheduler and implement task function in Arduin. 這個範例說明如何在Arduino中創建FreeRTOS的任務、呼叫調度器,以及實現任務函數。 1. Only one task in the running state at any one time, the others are in the not running time. 2. Create two print tasks with the same priority. 3. Create two print tasks with different priorities. Only higher priority task is running. (Staved situation happens.) 1. 在任意的時間點只有一個任務能在執行狀態執行,其他的任務都在非執行狀態。 2. 建立兩個任務,有一樣的優先順序。 3. 建立兩個任務,有不同的優先順序。只有優先順序高的任務會被執行。(會有"餓死"的狀況發生。)

[Arduino] Edit Arduino code to control RGB LED in VS code/使用VS code編輯Arduino程式碼來控制RGB LED

圖片
  This video show the blinking of RGB LED controlled by Mega2560. 本影片展示用Mega2560控制RGB LED閃爍的狀況。 Next video will express how to implement it by editing the Arduino code in the VS Code. 下一個影片將說明如何使用VS Code來編寫Arduino code來實現這樣的控制。 This video shows how to write the Arduino code of RGB LED blinking by using the VS code. 本部影片展示如何使用VS code去編輯控制RGB LED閃爍的Arduino程式碼。 Hardware: Mega2560 硬體: Mega2560 Steps: 1. Use command "Arduino: Initialize" to create .ino file. 2. Modify "c_cpp_properties.json" to add the content of include path and setup other parameters. 3. Modify "arduino.json" to add build file for fast compilaton. 3. Edit code in VS code. 4. Upload code to Mega2560 board. 5. View Blink.ino in Arduino IDE. 步驟: 1. 使用"Arduino: Initialize" 去建立 .ino檔。 2. 修正 "c_cpp_properties.json" 去新增 include path的內容和設置其他參數。 3. 修正"arduino.json" 去新增 build資料夾讓編譯速度加快。 3. 在 VS code中編輯程式碼。 4. 上傳程式碼到Mega2560板中。 5. 在Arduino IDE中察看 Blink.ino檔案。

[Arduino]Install FreeRTOS in Arduino/在Arduino中安裝FreeRTOS

圖片
This video shows how to install FreeRTOS library in Arduino IDE.  這影片說明如何在Arduino IDE中安裝FreeRTOS的程式庫。

[LabVIEW][Arduino] Read/Write data between BLED112 dongle and ESP32/在BLED112適配器和ESP32間讀寫資料

圖片
This example shows how BLED112 dongle receive data from ESP32 development board and then send data back to ESP32 and print data on the COM port monitor. 這個範例說明BLED112 dongle如何從ESP32開發版上收取資料,以及將資料送回ESP32並將資料列印在串列埠監控視窗上。 The next video will show to edit Labview program of BLED112 and Arduino code of ESP32. 下一個影片我們將說明如何轉寫BLED112的LabVIEW程式,以及ESP32的Arduino程式碼。 1. Introduce LabVIEW example code of BLED112 dongle and Arduino code of ESP32 development board. 2. BLE Scan and connection between BLED112 and ESP32. 3. Find Service UUID and Characteristic UUID Rx/Tx of ESP32 in LabVIEW program. Next video will shows how BLED112 dongle reads and write string to ESP32. 1. 簡介BLED112 dongle的LabVIEW程式內容和ESP32開發版的Arduino程式碼。 2. BLED112 and ESP32之間的低功號藍芽掃描與連結。 3. 在LabVIEW程式中找到ESP32的Service UUID和Characteristic UUID Rx/Tx。 下一個影片將說明BLED112 dongle何和讀寫字串到ESP32開發版上。 1. Add while loop in LabVIEW code to read/write data to ESP32 continuously. 2. Convert unit8 value to 3 digits ASCII code in LabVIEW code. 3. Wr...

[AI2][Arduino][ESP32] Classic Bluetooth connection between ESP32 and AI2 App/傳統藍芽傳輸使用ESP32與AI2

圖片
This example demonstrates how to use the classic Bluetooth of ESP32 to read and write data from App created by App Inventor 2. 這個範例說明如何使用經典的藍芽連線方式,在ESP32開發版與App Inventor 2開發出來的 App間進行資料的讀寫。 1. Upload SerialToSerialBT code to ESP32 DevKitc_V4 2. Input string to the serial port monitor to transmit data to App. 3. Input a string to the Write Textbox and tap the Write Button in the App to send data to ESP32 board. 1. 上傳SerialToSerialBT.ino程式碼到ESP32 DevKitc_V4開發版 2. 在Arduino串列埠監控視窗輸入文字,傳送到App中。 3. 在App的 寫入文字方塊中輸入文字,按下寫入的按鈕,將資料傳輸到ESP32開發版上。 In the next video, I will demonstrate how to implement the classic bluetooth app by using App Inventor 2. 下一個影片,我們將展示如何使用App Inventor 2寫一個經典藍芽傳輸的App。 1. Start new project to create designer and blocks windows 開啟新專案建立designer與block視窗 2. Place ListPicker for displaying address and name of bluetooth and Label for showing the result of connection 放置ListPicker顯示藍芽的地址以及名稱,放置Label顯示藍芽連線的結果。 3. Place buttons and texboxes for reading and writing texts 放置讀與寫的按...

[Arduino][VS Code][Voice] Edit Arduino code in the VS code/在VS Code中編輯Arduino程式碼

圖片
This example shows how to install Arduino extension and edit Arduino code in the VS code. 這個範例說明如何在VS Code中安裝Arduino extension以及編輯Arduino程式碼。 1. Install Arduino extension in the VS code. 在VS code中安裝Arduino extension。 2. Set Arduino installation Path. 設定 Arduino的安裝路徑。 3. Ctrl+Shift+P to input command " Arduino: Examples". 使用 Ctrl+Shift+P去輸入"Arduino: Examples"指令。 4. Open Blinky example 打開Blink的範例 5. Select COM port and board type "Mega2560". 選擇COM port, 以及Mega2560開發版。 6. Modify code and upload to Mega2560. 修改程式碼然後上傳到Mega2560上。 We will share more tutorial videos with people who want to learn LabVIEW and Python welcome to subscribe this channel. 未來會陸續更新影片,讓想學習LabVIEW和Python的朋友可以看影片學習,歡迎訂閱此頻道。 其他網址/related websites: https://labview-tech.blogspot.com/ https://fishark.pixnet.net/blog email: jacklee3633@gmail.com Line: lvnet

在Arduino IDE安裝ESP32 Add-On

圖片
為了在Arduino上開發ESP32的開發版,我們需要在Arduino IDE上裝ES32 Add-On, 安裝Arduino IDE1.8.9  1. 到  https://www.arduino.cc/en/Main/Donate  下載Arduino IDE,選just download即可。 2. 安裝Arduino IDE 2. 安裝ESP32 Add-On 在Arduino IDE中,檔案-->偏好設定,再額外的開發版管理員網址中輸入: https://dl.espressif.com/dl/package_esp32_index.json 按確定。 在Arduino IDE中,工具-->開發版-->開發版管理員,搜尋 ESP32, 然後安裝 ESP32 by Espressif Systems 選擇ESP32 Devkit開發版 開啟範例WIFI scan 執行,開啟工具-->串列埠監控視窗,即可看到附近WIFI訊號的掃瞄資訊 參考 ESP32-DevKitC V4 Getting Started Guide ( https://docs.espressif.com/projects/esp-idf/en/latest/get-started/get-started-devkitc.html )