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 放置讀與寫的按鈕以及文字區塊
4. Place a button for bluetooth disconnection 放置解除連線的按鈕
5. Pace bluetoothclient component 放置bluetoothclient元件
6. Use listpicker for the selection bluetooth device 使用ListPicker來選擇藍芽裝置
7. Connect the selected bluetooth device and set text and color of the connection label 與被選擇的裝置連線,並設定Connection Label的文字與顏色
8. Disonnect the selected bluetooth device and set text and color of the connection label 與被選擇的裝置解除連線,並設定Connection Label的文字與顏色
9. Write text to the selected bluetooth device 寫入文字到被選擇的藍芽裝置上
10. Recieve/read text from the selected bluetooth device 從被選擇的藍壓裝置收到/讀取文字
 

fishark 發表在 痞客邦 留言(0) 人氣()

BT arduino recieve 001.jpg
使用App Inventor 2開發藍牙(Bluetooth)Android app,接收從Arduino Mega2560傳送的資料,
這個範例許多網站也有提供類似內容,不過有些並沒有將App linentor 2與Arduino的程式碼一起提供,
首先demo app inventor 2的Designer與Block部分,
Designer,注意有加入藍芽與Timer,

fishark 發表在 痞客邦 留言(5) 人氣()

BT arduino003.jpg
接下來會使用MIT的App Inventor 2開發藍牙(Bluetooth)Android app,傳送資料到Arduino Mega2560上,
使用的藍牙模組是HC-06,目前App Inventor 2並不支援BLE,但要享受無線控制的樂趣也並不是一定要使用BLE,
重點是動手作的樂趣,使用App Inventor 2,Arduino,以及HC-06,如果你想要自己組一台遙控車,相信也不是一件難事。
關於雙A(Android與arduino)的藍牙模組溝通,網路上也有不少文章,都可以參考。

fishark 發表在 痞客邦 留言(0) 人氣()

appinventor004.jpg
由於想要快速製作Android的Bluetooth程式,所以就試了一下App Inventor 2,
這是個有趣的開發環境,可以完全在線上開發,只要有gmail帳號就可以使用,很方便。
如果是要簡單的程式,一下就可以完成,
雖然最後發現App Inventor 2目前不支援BLE,對於複雜的程式也不適合,

fishark 發表在 痞客邦 留言(0) 人氣()

1
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。