步驟1:材料:
2號Arduino(足夠納米)
10k電位計
Hc-05藍牙模塊
Hc-06藍牙模塊
步驟2:發射器電路:
Hc-05藍牙模塊4.p將tx引腳,3.pi的RX引腳連接到我的領帶。
步驟3:接收器電路:
10.pin讓我們將伺服信號連接到該引腳。 HC-06模塊TX到RX的引腳4.pin 3.pin到我的領帶。
第4步:發送器軟件:
///Royimek的Yaz?l?mGeli?tirme– 2015
///Robymek的Yaz?l?mLisans
//www.robimek.com
#include
#define BT_SERIAL_TX 4
#define BT_SERIAL_RX 3
軟件串行BluetoothSerial(BT_SERIAL_TX,BT_SERIAL_RX);
?ntpotpin = A0;
int val;
void setup()
{
Serial.begin(9600);
BluetoothSerial.begin(9600);
}
無效循環()
{
val = map(val,0,1023,0,179);
BluetoothSerial.print(val);
延遲(100);
}
步驟5:接收器軟件:
///Yaz?l?mGeli?tirme,Robymek – 2015
//Yaz?l?mLisans,Robymek
//www.robimek.com
#include
#define BT_SERIAL_TX 4
#define BT_SERIAL_RX 3
SoftwareSerial BluetoothSerial(BT_SERIAL_TX,BT_SERIAL_RX);
#include
Servo myservo;
Servo myservo; char val =‘’;
void setup()
{
Serial.begin(9600);
BluetoothSerial.begin(9600);
myservo.attach(10);
}
void loop()
{
if(BluetoothSerial.available()》 0)
{
val = BluetoothSerial.read();
int伺服角度= val –‘0’;
myservo.write(servoAng);
}
}
第6步:最后
安裝軟件后,您現在可以通過電位計無線管理您的動力引擎。
-
藍牙
+關注
關注
114文章
5866瀏覽量
171216 -
伺服電機
+關注
關注
85文章
2057瀏覽量
58190 -
電位計
+關注
關注
0文章
253瀏覽量
17019
發布評論請先 登錄
相關推薦
評論