1. Trang chủ
  2. » Giáo Dục - Đào Tạo

Xe mô hình tránh vật cản điều khiển bằng bluetooth

30 13 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Nội dung

Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth Xe mô hình tránh vật cản điều khiển bằng bluetooth

TRƯỜNG ĐẠI HỌC BÁCH KHOA HÀ NỘI VIỆN CƠ KHÍ ********************** BÁO CÁO BÀI TẬP LỚN MÔN KĨ THUẬT LẬP TRÌNH Đề tài: Xe mơ hình tránh vật cản điều khiển Bluetooth Giảng viên hướng dẫn: TS Trương Công Tuấn Lớp: Cơ điện tử Nhóm sinh viên thực hiện: Hà Nội 8-2021 Mục lục Tóm tắt cơng trình I Đặt vấn đề: II Các linh kiện cụ thể Arduino UNO R3 Module điều khiển động L298 mạch cầu H Cảm biến khoảng cách HC-SR04 : Bluetooth HC-06: Động Servo SG -90: 11 IV Sơ đồ nối mạch sơ đồ thuật toán: 14 Sơ đồ nối mạch 14 Sơ đồ thuật toán 15 a Sơ đồ điều khiển winform 15 b.Sơ đồ chạy tự động 16 V Lập trình 16 Code Arduino: 16 Code Visual Studio giao diện điều khiển: 21 VI Tài liệu tham khảo: 30 Tóm tắt cơng trình Sản phẩm: Xe mơ hình tránh vật cản điều khiển Bluetooth Chức năng: Xe tránh vật cản điều khiển chế độ thông qua window form modul bluetooth HC-06:  Tự động  Tự điều khiển nút bấm window form Linh kiện cấu tạo :  Giá đỡ kích thước 70*85mm  Hai bánh xe đường kính 35mm gắn vào trục động khác  Một bánh xe đa hướng gắn đầu xe  động DC chiều  Nguồn pin 12V  Arduino UNO  Module điều khiển động L298 mạch cầu  Cảm biến khoảng HC-SR04  Động SERVO  Bluetooth HC-06 I Đặt vấn đề: - Các loại máy móc khí ngày trở nên lỗi thời, việc sử dụng chúng sản xuất nhiều công sức thời gian người sử dụng Do đó, kết hợp hệ thống điện với điện tử lập trình tạo đột phá công dụng vô to lớn Để chuẩn bị cho thời đại công nghiệp nay, từ ngồi giảng đường, sinh viên nên học thực hành với sản phẩm mang kết hợp - Mục đích đề tài áp dụng kiến thức học từ môn học Kĩ thuật Lập trình Cơ Điện Tử vào việc thiết kế xe tự hành có khả tự động di chuyển tránh vật cản điều khiển qua Bluetooth - Robot có nhiệm vụ di chuyển theo bảng điều khiển máy tính lập trình sẵn thơng qua Bluetooth tiến, lùi, quay trái, quay phải, tự nhận biết vật cản, khoảng cách tránh vật cản II Các linh kiện cụ thể Arduino UNO R3 Một board mạch chủ dùng để truyền nhận liệu từ người sử dụng đến thiết bị điện tử khác Các thông số bản: Vi điều khiển Điện áp hoạt động Tần số hoạt động Dòng tiêu thụ Điện áp vào khuyên dùng Điện áp vào giới hạn Số chân Digital I/O Số chân Analog Dòng tối đa chân I/O Dòng tối đa (5V) Dòng tối đa (3.3V) SRAM ATmega328 họ 8bit 5V DC (chỉ cấp qua cổng USB) 16 MHz khoảng 30mA 7-12V DC 6-20V DC 14 (6 chân hardware PWM) (độ phân giải 10bit) 30 mA 500 mA 50 mA 32 KB (ATmega328) với 0.5KB dùng bootloader KB (ATmega328) EEPROM KB (ATmega328) Bộ nhớ flash Module điều khiển động L298 mạch cầu H Thông số kỹ thuật:           Driver: L298N tích hợp hai mạch cầu H Điện áp điều khiển: +5 V ~ +12 V Dòng tối đa cho cầu H là: 2A (=>2A cho motor) Điện áp tín hiệu điều khiển: +5 V ~ +7 V Dịng tín hiệu điều khiển: ~ 36mA Cơng suất hao phí: 20W (khi nhiệt độ T = 75 ℃) Nhiệt độ bảo quản: -25 ℃ ~ +130 ℃ L298 gồm chân: 12V power, 5V power Đây chân cấp nguồn trực tiếp đến động Có thể cấp nguồn 9-12V 12V *Nguyên lí hoạt động: - Chúng ta điều khiển tốc độ động DC cách điều khiển điện áp đầu vào động phương pháp phổ biến để làm điều sử dụng tín hiệu PWM - PWM hay thay đổi độ rộng xung kỹ thuật cho phép điều chỉnh giá trị trung bình điện áp đến thiết bị điện tử cách bật tắt nguồn với tốc độ nhanh Điện áp trung bình phụ thuộc vào chu kỳ xung, lượng thời gian tín hiệu BẬT so với lượng thời gian tín hiệu TẮT khoảng thời gian quy định Vì vậy: Tùy thuộc vào kích thước động cơ, cần kết nối đầu Arduino với chân cua điện trở chân MOSFET điều khiển tốc độ động cách điều khiển đầu PWM Tín hiệu Arduino cơng suất thấp bật tắt chân MOSFET thơng qua động công suất cao điều khiển Điều khiển động DC mạch cầu H Mặt khác, để điều khiển hướng quay, cần đảo ngược hướng dòng điện qua động cơ, phương pháp phổ biến để làm điều sử dụng mạch cầu H Một mạch cầu H chứa bốn chân chuyển mạch, điện trở MOSFET, với động trung tâm tạo thành cấu hình giống chữ H Bằng cách kích hoạt hai cơng tắc cụ thể lúc, thay đổi hướng dịng điện, thay đổi hướng quay động Cảm biến khoảng cách HC-SR04 : Cảm biến siêu âm có chức để đo khoảng cách cách áp dụng cơng thức tính tốn khoảng cách dựa thời gian vận tốc sóng cao tần phát *Thơng số kĩ thuật:        Điện áp: 5V DC Dòng hoạt động: < 2mA Mức cao: 5V Mức thấp: 0V Góc tối đa: 15 độ Khoảng cách: 2cm – 450cm (4.5m) Độ xác: 3mm *Các chân chức năng: VCC Cấp nguồn cho cảm biến (5V) 3.3V cảm biến 3V3 TRIGGER Chân phát sóng âm Là chu kỳ của điện cao /thấp diễn ECHO Trạng thái ban dầu 0V, có tín hiệu trả 5V sau trở 0V GND Nối cực âm mạch OUT Không sử dụng *Nguyên lí hoạt động: Để đo khoảng cách, ta phát xung ngắn (5 microSeconds) từ chân Trig Sau đó, cảm biến siêu âm tạo xung HIGH chân Echo nhận lại sóng phản xạ pin Chiều rộng xung với thời gian sóng siêu âm phát từ cảm biển quay trở lại Tốc độ âm khơng khí 340 m/s (hằng số vật lý), tương đương với 29,412 microSeconds/cm (106 / (340*100)) Khi tính thời gian, ta chia cho 29,412 để nhận khoảng cách Bluetooth HC-06: -Module Bluetooth SLAVE cho phép vi điều khiển kết nối với thiết bị ngoại vi: smartphone, laptop, usb bluetooth thông qua giao tiếp Serial gửi nhận tín hiệu chiều Module bluetooth tích hợp board cho phép bạn sử dụng nguồn từ DC 3.5 - 5V - Module Bluetooth SLAVE cho phép vi điều khiển kết nối với thiết bị ngoại vi: smartphone, laptop, usb bluetooth thông qua giao tiếp Serial gửi nhận tín hiệu chiều - Module bluetooth tích hợp board cho phép bạn sử dụng nguồn từ 3.5V đến 6V cung cấp cho board mà không cần lo lắng chênh lệch điện áp 3V - 5V gây hỏng board - Module Bluetooth gồm chân theo thứ tự: KEY, VCC, GND, TX, RX, STATE.Đây module bluetooth SLAVE nghĩa bạn chủ động kết nối vi điều khiển, mà cần sử dụng smartphone, laptop, bluetooth usb để dị tín hiệu kết nối (pair) từ smartphone, laptop, bluetooth usb Sau kết nối thành cơng, bạn gửi nhận tín hiệu từ vi điều khiển đến thiết bị - Không gắn lộn dây Vcc Gnd gây hỏng module bluetooth lập tức.Mặc định, module bluetooth SLAVE sử dụng baud rate 9600, PIN 1234 Thông số kỹ thuật:  Điện áp hoạt động: 3.3 ~ 5VDC  Điện áp giao tiếp: TTL tương thích 3.3VDC 5VDC  Chip CSR Bluetooth V  Baudrate UART( tốc độ hỗ trợ) chọn được: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200  Dải tần sóng hoạt động: Bluetooth 2.4GHz  Phạm vi hoạt động 8m ( hiệu 5m)  Dòng hoạt động : 20-30mA  Tốc độ : +Asynchronous : 2.1Mbps/160kbps 10 V Lập trình Code Arduino: #include #define trig #define echo Servo myservo; #define enA #define inA1 #define inA2 #define inB1 #define inB2 10 #define enB 11 int x=0; int spd=0; 16 void setup() { pinMode(inA1, OUTPUT); pinMode(inA2, OUTPUT); pinMode(inB1, OUTPUT); pinMode(inB2, OUTPUT); pinMode(trig,OUTPUT); pinMode(echo,INPUT); Serial.begin(9600); myservo.attach(5); myservo.write(90); delay(500); } void loop() { //Tranh_Vat_Can(40); bluetoothRobot(); } void bluetoothRobot() { if (Serial.available() > 0) { x = Serial.read(); } switch (x) { case 'a': Tien(); break; case 'b': Lui(); break; case 'd': Retrai(); break; case 'c': Rephai(); break; case 'e': Dung(); 17 break; case 'f': Tranh_Vat_Can(40); break; case '1': spd=100; break; case '2': spd=125; break; case '3': spd=150; break; case '4': spd=200; break; case '5': spd=255; break; } } void Tien() { analogWrite(enA,spd-15); analogWrite(enB,spd-30); digitalWrite(inA1, HIGH); digitalWrite(inA2, LOW); digitalWrite(inB1, HIGH); digitalWrite(inB2, LOW); } void Lui() { analogWrite(enA,spd-15); analogWrite(enB,spd-30); digitalWrite(inA1, LOW); digitalWrite(inA2, HIGH); digitalWrite(inB1, LOW); digitalWrite(inB2, HIGH); } void Retrai() { analogWrite(enA,spd-15); analogWrite(enB,spd-30); digitalWrite(inA2,LOW); 18 digitalWrite(inA1,HIGH); digitalWrite(inB1,LOW); digitalWrite(inB2,LOW); } void Rephai() { analogWrite(enA,spd-15); analogWrite(enB,spd-30); digitalWrite(inA1,LOW); digitalWrite(inA2,LOW); digitalWrite(inB2,LOW); digitalWrite(inB1,HIGH); } void Dung() { digitalWrite(inA1, LOW); digitalWrite(inA2, LOW); digitalWrite(inB1, LOW); digitalWrite(inB2, LOW); } int TinhKC (byte goc) { myservo.write(goc); delay(500); unsigned long times; int KC; digitalWrite(trig,0); delayMicroseconds(2); digitalWrite(trig,1); delayMicroseconds(5); digitalWrite(trig,0); times = pulseIn(echo,HIGH); KC = int(times/2/29.412); return KC; } void Tranh_Vat_Can(byte KC_choPhep) { //Tien(); int KC_phiaTruoc = TinhKC(90); if (KC_phiaTruoc > KC_choPhep) 19 { Tien(); delay(100); } else //(KC_phiaTruoc comboBox2->DataSource = tocdotruyen; comboBox2->SelectedIndex = 1; this->comboBox3->DataSource = speed; this->comboBox1->DataSource = oBarray; comboBox1->SelectedIndex = 1;*/ } protected: /// /// Clean up any resources being used 21 /// ~MyForm() { if (components) { delete components; } } private: System::Windows::Forms::Button^ button1; private: System::Windows::Forms::Label^ label1; private: System::Windows::Forms::Button^ button2; private: System::Windows::Forms::Button^ button3; private: System::Windows::Forms::Button^ button4; private: System::Windows::Forms::Button^ button5; private: System::Windows::Forms::Button^ button6; private: System::Windows::Forms::Button^ button7; private: System::Windows::Forms::Button^ button8; private: System::Windows::Forms::Label^ label2; private: System::Windows::Forms::Label^ label3; private: System::Windows::Forms::Label^ label4; private: System::Windows::Forms::Label^ label5; private: System::Windows::Forms::ComboBox^ comboBox1; private: System::Windows::Forms::ComboBox^ comboBox2; private: System::Windows::Forms::ComboBox^ comboBox3; private: public: System::IO::Ports::SerialPort^ serialPort1; private: private: System::ComponentModel::IContainer^ components; protected: private: /// /// Required designer variable /// #pragma region Windows Form Designer generated code /// /// Required method for Designer support - not modify /// the contents of this method with the code editor /// void InitializeComponent(void) { this->components = (gcnew System::ComponentModel::Container()); this->button1 = (gcnew System::Windows::Forms::Button()); this->label1 = (gcnew System::Windows::Forms::Label()); this->button2 = (gcnew System::Windows::Forms::Button()); this->button3 = (gcnew System::Windows::Forms::Button()); this->button4 = (gcnew System::Windows::Forms::Button()); 22 this->button5 = (gcnew System::Windows::Forms::Button()); this->button6 = (gcnew System::Windows::Forms::Button()); this->button7 = (gcnew System::Windows::Forms::Button()); this->button8 = (gcnew System::Windows::Forms::Button()); this->label2 = (gcnew System::Windows::Forms::Label()); this->label3 = (gcnew System::Windows::Forms::Label()); this->label4 = (gcnew System::Windows::Forms::Label()); this->label5 = (gcnew System::Windows::Forms::Label()); this->comboBox1 = (gcnew System::Windows::Forms::ComboBox()); this->comboBox2 = (gcnew System::Windows::Forms::ComboBox()); this->comboBox3 = (gcnew System::Windows::Forms::ComboBox()); this->serialPort1 = (gcnew System::IO::Ports::SerialPort(this->components)); this->SuspendLayout(); // // button1 // this->button1->Location = System::Drawing::Point(468, 33); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(75, 30); this->button1->TabIndex = 0; this->button1->Text = L"Auto"; this->button1->UseVisualStyleBackColor = true; this->button1->Click += gcnew System::EventHandler(this, &MyForm::button1_Click); // // label1 // this->label1->AutoSize = true; this->label1->ForeColor = System::Drawing::SystemColors::MenuHighlight; this->label1->Location = System::Drawing::Point(111, 33); this->label1->Name = L"label1"; this->label1->Size = System::Drawing::Size(100, 17); this->label1->TabIndex = 1; this->label1->Text = L"Not connected"; // // button2 // this->button2->Location = System::Drawing::Point(42, 350); this->button2->Name = L"button2"; this->button2->Size = System::Drawing::Size(90, 28); this->button2->TabIndex = 2; this->button2->Text = L"Connect"; this->button2->UseVisualStyleBackColor = true; this->button2->Click += gcnew System::EventHandler(this, &MyForm::button2_Click); // // button3 // this->button3->Location = System::Drawing::Point(42, 392); this->button3->Name = L"button3"; this->button3->Size = System::Drawing::Size(90, 28); this->button3->TabIndex = 3; this->button3->Text = L"Disconnect"; this->button3->UseVisualStyleBackColor = true; 23 this->button3->Click += gcnew System::EventHandler(this, &MyForm::button3_Click); // // button4 // this->button4->Location = System::Drawing::Point(270, 81); this->button4->Name = L"button4"; this->button4->Size = System::Drawing::Size(60, 55); this->button4->TabIndex = 4; this->button4->Text = L"Down"; this->button4->UseVisualStyleBackColor = true; this->button4->MouseDown += gcnew System::Windows::Forms::MouseEventHandler(this, &MyForm::button4_MouseDown); this->button4->MouseUp += gcnew System::Windows::Forms::MouseEventHandler(this, &MyForm::button4_MouseUp); // // button5 // this->button5->Location = System::Drawing::Point(270, 233); this->button5->Name = L"button5"; this->button5->Size = System::Drawing::Size(60, 55); this->button5->TabIndex = 5; this->button5->Text = L"Up"; this->button5->UseVisualStyleBackColor = true; this->button5->MouseDown += gcnew System::Windows::Forms::MouseEventHandler(this, &MyForm::button5_MouseDown); this->button5->MouseUp += gcnew System::Windows::Forms::MouseEventHandler(this, &MyForm::button5_MouseUp); // // button6 // this->button6->Location = System::Drawing::Point(348, 156); this->button6->Name = L"button6"; this->button6->Size = System::Drawing::Size(60, 55); this->button6->TabIndex = 6; this->button6->Text = L"Right"; this->button6->UseVisualStyleBackColor = true; this->button6->MouseDown += gcnew System::Windows::Forms::MouseEventHandler(this, &MyForm::button6_MouseDown); this->button6->MouseUp += gcnew System::Windows::Forms::MouseEventHandler(this, &MyForm::button6_MouseUp); // // button7 // this->button7->Location = System::Drawing::Point(187, 156); this->button7->Name = L"button7"; this->button7->Size = System::Drawing::Size(60, 55); this->button7->TabIndex = 7; this->button7->Text = L"Left"; this->button7->UseVisualStyleBackColor = true; this->button7->MouseDown += gcnew System::Windows::Forms::MouseEventHandler(this, &MyForm::button7_MouseDown); 24 this->button7->MouseUp += gcnew System::Windows::Forms::MouseEventHandler(this, &MyForm::button7_MouseUp); // // button8 // this->button8->Location = System::Drawing::Point(270, 156); this->button8->Name = L"button8"; this->button8->Size = System::Drawing::Size(60, 55); this->button8->TabIndex = 8; this->button8->Text = L"Stop"; this->button8->UseVisualStyleBackColor = true; this->button8->MouseDown += gcnew System::Windows::Forms::MouseEventHandler(this, &MyForm::button8_MouseDown); // // label2 // this->label2->AutoSize = true; this->label2->ForeColor = System::Drawing::Color::DarkGreen; this->label2->Location = System::Drawing::Point(39, 33); this->label2->Name = L"label2"; this->label2->Size = System::Drawing::Size(48, 17); this->label2->TabIndex = 9; this->label2->Text = L"Status"; // // label3 // this->label3->AutoSize = true; this->label3->Location = System::Drawing::Point(453, 350); this->label3->Name = L"label3"; this->label3->Size = System::Drawing::Size(39, 17); this->label3->TabIndex = 10; this->label3->Text = L"COM"; // // label4 // this->label4->AutoSize = true; this->label4->Location = System::Drawing::Point(453, 392); this->label4->Name = L"label4"; this->label4->Size = System::Drawing::Size(70, 17); this->label4->TabIndex = 11; this->label4->Text = L"Baud rate"; // // label5 // this->label5->AutoSize = true; this->label5->Location = System::Drawing::Point(453, 432); this->label5->Name = L"label5"; this->label5->Size = System::Drawing::Size(49, 17); this->label5->TabIndex = 12; this->label5->Text = L"Speed"; // // comboBox1 25 // this->comboBox1->FormattingEnabled = true; this->comboBox1->Location = System::Drawing::Point(234, 350); this->comboBox1->Name = L"comboBox1"; this->comboBox1->Size = System::Drawing::Size(130, 24); this->comboBox1->TabIndex = 13; // // comboBox2 // this->comboBox2->FormattingEnabled = true; this->comboBox2->Location = System::Drawing::Point(234, 392); this->comboBox2->Name = L"comboBox2"; this->comboBox2->Size = System::Drawing::Size(130, 24); this->comboBox2->TabIndex = 14; // // comboBox3 // this->comboBox3->FormattingEnabled = true; this->comboBox3->Location = System::Drawing::Point(234, 432); this->comboBox3->Name = L"comboBox3"; this->comboBox3->Size = System::Drawing::Size(130, 24); this->comboBox3->TabIndex = 15; this->comboBox3->SelectedValueChanged += gcnew System::EventHandler(this, &MyForm::comboBox3_SelectedValueChanged); // // MyForm // this->AutoScaleDimensions = System::Drawing::SizeF(8, 16); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(588, 482); this->Controls->Add(this->comboBox3); this->Controls->Add(this->comboBox2); this->Controls->Add(this->comboBox1); this->Controls->Add(this->label5); this->Controls->Add(this->label4); this->Controls->Add(this->label3); this->Controls->Add(this->label2); this->Controls->Add(this->button8); this->Controls->Add(this->button7); this->Controls->Add(this->button6); this->Controls->Add(this->button5); this->Controls->Add(this->button4); this->Controls->Add(this->button3); this->Controls->Add(this->button2); this->Controls->Add(this->label1); this->Controls->Add(this->button1); this->Name = L"MyForm"; this->Text = L"MyForm"; this->Load += gcnew System::EventHandler(this, &MyForm::MyForm_Load); this->ResumeLayout(false); this->PerformLayout(); 26 } #pragma endregion private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { this->serialPort1->Write("f"); MessageBox::Show("Ban da cho che tu dong!"); } private: System::Void button4_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { this->serialPort1->Write("a"); } private: System::Void button8_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { this->serialPort1->Write("e"); } private: System::Void button5_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { this->serialPort1->Write("b"); } private: System::Void button6_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { this->serialPort1->Write("c"); } private: System::Void button7_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { this->serialPort1->Write("d"); } private: System::Void MyForm_Load(System::Object^ sender, System::EventArgs^ e) { array^ oBarray = SerialPort::GetPortNames(); this->comboBox2->DataSource = tocdotruyen; this->comboBox2->SelectedIndex = 1; this->comboBox3->DataSource = speed; this->comboBox1->DataSource = oBarray; this->comboBox1->SelectedIndex = 0; } private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { label1->Text = "Connected"; label1->ForeColor = Color::Coral; this->serialPort1->BaudRate = System::Convert::ToInt32(this->comboBox2->Text>ToString()); this->serialPort1->PortName = this->comboBox1->Text; this->serialPort1->Open(); //serialPort1->Write(this->comboBox3->Text->ToString()); comboBox1->Enabled = false; 27 comboBox2->Enabled = false; comboBox3->Enabled = false; } private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) { label1->Text = "Disconnected"; label1->ForeColor = Color::Red; serialPort1->Close(); comboBox1->Enabled = true; comboBox2->Enabled = true; comboBox3->Enabled = true; } private: System::Void button4_MouseUp(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { serialPort1->Write("e"); } private: System::Void button6_MouseUp(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { serialPort1->Write("e"); } private: System::Void button5_MouseUp(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { serialPort1->Write("e"); } private: System::Void button7_MouseUp(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { serialPort1->Write("e"); } private: System::Void comboBox3_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e) { this->serialPort1->BaudRate = System::Convert::ToInt32(this->comboBox2->Text>ToString()); this->serialPort1->PortName = this->comboBox1->Text; this->serialPort1->Open(); if (this->comboBox3->Text == "100") { serialPort1->Write("1"); } else if (this->comboBox3->Text == "125") { serialPort1->Write("2"); } else if (this->comboBox3->Text == "150") 28 { serialPort1->Write("3"); } else if (this->comboBox3->Text == "200") { serialPort1->Write("4"); } else if (this->comboBox3->Text == "255") { serialPort1->Write("5"); } serialPort1->Close(); }; } } V Kết thu kết luận Kết luận : Hướng đề tài : Ứng dụng công nghệ Bluetooth vào hệ thống, điều khiển tự động khác thông qua điều khiển giao diện My form Tích cực : - Hiểu nguyên lý, cách thức hoạt động cảm biến, linh kiện điện tử - Biết cách xây dựng, thiết kế xe tự hành, điều khiển xe thông qua Bluetooth - Sử dụng kiến thức học để lập trình điều khiển, xây dựng giao diện My form - Nâng cao khả hoạt động nhóm, biết phân chia công việc, hoạt động hiệu Hạn chế : - Không thể gặp mặt trực tiếp để lắp đặt , kiểm tra vận hành - Khó khăn việc giao tiếp, cách diễn đạt ý thành viên khác hiểu, cố kỹ thuật, mạng - Khó khăn mua linh kiện Quá trình thực đề tài giúp chúng em thu kết tốt, bổ sung nhiều phần kiến thức chưa hiểu rõ trình học tập hiểu rõ trình thiết kế, thực ý tưởng kỹ thuật đơn giản Môn học cho sinh viên chúng em môi trường làm việc thân thiện, sáng tạo, kích thích tìm tịi Chúng em xin gửi lời cảm ơn tới TS Trương Công Tuấn tận tình hướng dẫn, góp ý chúng em q trình thực đề tài VI Tài liệu tham khảo: https://arduino.vn/ https://stackoverflow.com/ 30 ... cơng trình Sản phẩm: Xe mơ hình tránh vật cản điều khiển Bluetooth Chức năng: Xe tránh vật cản điều khiển chế độ thông qua window form modul bluetooth HC-06:  Tự động  Tự điều khiển nút bấm window... học từ môn học Kĩ thuật Lập trình Cơ Điện Tử vào việc thiết kế xe tự hành có khả tự động di chuyển tránh vật cản điều khiển qua Bluetooth - Robot có nhiệm vụ di chuyển theo bảng điều khiển máy... MOSFET điều khiển tốc độ động cách điều khiển đầu PWM Tín hiệu Arduino cơng suất thấp bật tắt chân MOSFET thơng qua động cơng suất cao điều khiển Điều khiển động DC mạch cầu H Mặt khác, để điều khiển

Ngày đăng: 12/03/2022, 12:06

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w