步驟1:所需的硬件
對于該項目,您將需要:
-一個Arduino UNO
-一個LCD(液晶顯示器)
-一個面包板
-一個10K電位器
-一個BT模塊(我使用HC-05)
-跳線
-一個藍牙應用程序。對于Android用戶,我建議使用BlueTerm。對不起,iOS用戶,BlueTerm僅適用于Android 。..但是您仍然可以下載等效的應用程序。
不需要任何工具
2:構建電路
上面的圖像對應于以下準則:
首先,將LCD固定在面包板上,并通過以下方式為面包板供電將Arduino的“ 5V”(電源)線連接到面包板上的正極行,另一根從“ GND”線(接地或0V)連接到負極行。
然后將LCD連接到Arduino:
LCD引腳4-Arduino引腳2
引腳6-引腳3
引腳11-引腳4
引腳12-引腳5
引腳13-引腳6
引腳14-引腳7
之后,為LCD供電:
LCD引腳1 =面包板上的GND
Pin 2 = 5V
Pin 5 = GND
Pin 15 = 5V
Pin 16 = GND
然后將LCD上的引腳3連接到10K電位器的中心引腳,并用GND上的一個引腳和面包板上5V上的另一個引腳為電位器供電。
然后將藍牙模塊上的Tx(發送)引腳連接到Arduino上的Rx(接收),并將BT模塊上的Rx引腳連接到Arduino上的Tx。
最后,給BT供電通過將VCC(或5V)連接到面包板上的正極行并將GND連接到面包板上的負極端。
步驟3:代碼
現在讓我們編寫代碼:
#include //Include the library that enables you to use the LCD
LiquidCrystal lcd(2,3,4,5,6,7);//Declare that your LCD is connected to pins 2,3,4,5,6 & 7 on your Arduino
void setup() {
lcd.begin(16,2);//16 by 2 are the dimensions of the LCD (in number of characters)
Serial.begin(9600);//launch the process of receiving serial data (via bluetooth) at 9600 bits/s
}
void loop() {
if(Serial.available()){
lcd.write(Serial.read());//these two lines mean that if there is data coming from the BT module, the Arduino prints it on the LCD.
}
}
//Before uploading the code to the Arduino, disconnect the Tx and Rx pins, otherwise you won‘t be able to upload. Once the code uploaded, reconnect them.
現在打開BlueTerm,打開藍牙并連接HC-05。然后只需輸入您的文本,它就應該在LCD上打印!
-
智能手機
+關注
關注
66文章
18565瀏覽量
181383 -
藍牙
+關注
關注
114文章
5888瀏覽量
171511 -
Arduino
+關注
關注
188文章
6478瀏覽量
188217
發布評論請先 登錄
相關推薦
貼片NTC熱敏電阻在智能手機和平板上的應用

MEMS傳感器應用領域 MEMS技術在智能手機中的應用
探索智能手機上的生成式AI
CYC8PROTO-063-BLE是否可以通過智能手機上的標準設置應用程序建立連接?
OLED技術在智能手機領域持續高漲
ESP8266出現1103錯誤的原因?
如何學習智能家居?8:Text文本實體使用方法

如何使用標準BLE將CYBT-213043-02網狀代理連接到智能手機?
卷積神經網絡在文本分類領域的應用
Omdia:2024年,AMOLED在智能手機顯示面板市場的出貨量將超過TFT LCD

符合BLE 5.0,智能手機Mesh組網,可對接天貓精靈的藍牙模組

評論