Mundarija:
- 1 -qadam: materiallar
- 2 -qadam: qismlarni yig'ish
- 3 -qadam: Nano kodlash
- 4 -qadam: Mio -ga qismlarni o'rnatish
Video: Bluetooth roboti Mio: 4 qadam
2024 Muallif: John Day | [email protected]. Oxirgi o'zgartirilgan: 2024-01-30 13:23
1 -qadam: materiallar
1- Robot Mio
2- L298N kuchlanish regulyatori ikki dvigatelli haydovchi platasi
3- Arduino Nano
4- HC06 Bluetooth-seriyali modulli karta
5- (2x) 9 V batareya boshi
2 -qadam: qismlarni yig'ish
Avval dvigatel haydovchisining ulanishlaridan boshlaylik. Keling, motor haydovchisining in1, in2, in3, in4 pinlari ostidagi o'tish kabellarini lehimlaylik. (1 -rasmda) Keyin simni in1 -dan nanoning d6 -piniga, in2 -dan d10 -pinga, in3 -dan d5 -pingacha va oxir -oqibat in4 -d9 -pinli simni ulaymiz. (2 -rasmda bo'lgani kabi), keling, HC06 moduli bilan bog'lanamiz, keling, RXD pinini nano TXD piniga, TXD pinini RXD piniga, VCC va GND pinlarini har qanday 5v va GND nano pinlariga ulaymiz. (3 -rasmda) Va nihoyat, dvigatel aloqalarini o'rnataylik. Mio biz tomonga qaraganida, keling, to'g'ri dvigatel kabellarini dvigatel haydovchisining 3, 4 pimlariga, chap dvigatel kabellarini esa 1, 2 pinlarga ulaylik. nano va qora kabel GND piniga. (4 -rasmda) Keling, o'rtada o'tish simini kesib, uchini echib, nanoning GND piniga, dvigatel haydovchisining GND piniga ulaymiz. (5 -rasm, 6 -rasm) Keling, boshqa 9v akkumulyator boshining qizil kabelini 12v piniga, qora simni esa dvigatel haydovchisining pinlariga gnd piniga ulaylik. (7 -rasmdagi kabi)
3 -qadam: Nano kodlash
const int motorA1 = 5; // L298N ning IN3 Girishi
const int motorA2 = 6; // L298N ning IN1 Girishi const int motorB1 = 10; // L298N ning IN2 Girishi const int motorB2 = 9; // L298N ning IN4 Girishi
int i = 0; // Döngüler uchun atanan rastgele bir o'zgarken int j = 0; // Döngüler uchun atanan rastgele bir o'zgarken int state; // Bluetooth qurilmasidan keluvchi sinyalin o'zgarishi int vSpeed = 255; // Standart Hiz, 0-255 oralig'ida bir qiymatli bo'lishi mumkin
void setup () {// Pinlerimizni aniq belgilash pinMode (motorA1, OUTPUT); pinMode (motorA2, OUTPUT); pin rejimi (motorB1, OUTPUT); pin rejimi (motorB2, OUTPUT); // 9600 bod tezligida bir seri port ochalim Serial.begin (9600); } void loop () {// Bluetooth ulanishi koptugunda yoki kesilganida arabay turishi mumkin. // (Aktif qilish uchun pastki satrlar "//" larini olib tashlash.) // if (digitalRead (BTState) == LOW) {state = 'S'; }
// Gelen ma'lumotlarning 'holati' o'zgaruvchisiga yozilgan if (Serial.available ()> 0) {state = Serial.read (); } // Amaldan 4 tezlik darajasi. (Qiymatlar 0-255 orasida bo'lishi kerak) if (holat == '0') {vSpeed = 0;} else if (holat == '1') {vSpeed = 100;} if if (holat == '2') {vSpeed = 180;} boshqa bo'lsa (holat == '3') {vSpeed = 200;} boshqa bo'lsa (holat == '4') {vSpeed = 255;} /*** ******************** Ileri **************************/ // Gelen veri 'F' bo'lsa, avtomobil ileri gider. if (holat == 'F') {analogWrite (motorA1, vSpeed); analogWrite (motorA2, 0); analogWrite (motorB1, vSpeed); analogWrite (motorB2, 0); } /********************** Ileri Sol ************************ /// Gelen ma'lumotlar 'G' bo'lsa, avtomobil ileri sol (çapraz) gider. aks holda (holat == 'G') {analogWrite (motorA1, vSpeed); analogWrite (motorA2, 0); analogWrite (motorB1, 100); analogWrite (motorB2, 0); } /********************** Ileri Sağ ************************ /// Gelen ma'lumotlar 'I' bo'lsa, avtomobil ileri sog' (chopraz) gider. aks holda (holat == 'I') {analogWrite (motorA1, 100); analogWrite (motorA2, 0); analogWrite (motorB1, vSpeed); analogWrite (motorB2, 0); } /*********************** Geri *********************** ****/// Gelen ma'lumotlar 'B' bo'lsa, avtomobil qaytaradi. aks holda (holat == 'B') {analogWrite (motorA1, 0); analogWrite (motorA2, vSpeed); analogWrite (motorB1, 0); analogWrite (motorB2, vSpeed); } /********************** Geri Sol ************************ /// Gelen ma'lumoti 'H' bo'lsa, mashina geriga sol (chopraz) gider if if (state == 'H') {} /********************* *Geri Sağ **************************/// Gelen ma'lumotlar 'J' bo'lsa, avtomobilni qaytarib olish (chapraz) gider else if (state == ') J ') {analogWrite (motorA1, 0); analogWrite (motorA2, vSpeed); analogWrite (motorB1, 0); analogWrite (motorB2, 100); } /************************************************** *********/// Gelen ma'lumotlar 'L' bo'lsa, avtomobil sola gider. aks holda (holat == 'L') {analogWrite (motorA1, vSpeed); analogWrite (motorA2, 150); analogWrite (motorB1, 0); analogWrite (motorB2, 0); } /****************************************************** *********/// Gelen ma'lumotlar 'R' bo'lsa, avtomobil sog'a gider if if (state == 'R') {analogWrite (motorA1, 0); analogWrite (motorA2, 0); analogWrite (motorB1, vSpeed); analogWrite (motorB2, 150); } /************************STOP*********************** ******/// Gelen veri 'S' arababi durdur. aks holda (holat == 'S') {analogWrite (motorA1, 0); analogWrite (motorA2, 0); analogWrite (motorB1, 0); analogWrite (motorB2, 0); }} analogWrite (motorA1, 0); analogWrite (motorA2, 100); analogWrite (motorB1, 0); analogWrite (motorB2, vSpeed);
4 -qadam: Mio -ga qismlarni o'rnatish
Endi biz robot mio -ni birlashtirishning oxirgi bosqichidamiz
Tavsiya:
Suv osti suzish havzasi Bluetooth quyosh tozalash roboti: 8 qadam
Suv osti suzish havzasi Bluetooth Quyoshdan tozalash roboti: Mening uyimda basseyn bor, lekin suv havzalarining eng katta muammosi - suv filtri intilmasligi. Shunday qilib, pastdan kirni tozalash yo'lini o'ylab topdim. Va boshqa holatlarga kelsak
Otto DIY+ Arduino Bluetooth roboti 3D bosib chiqarish oson: 6 qadam (rasmlar bilan)
Otto DIY+ Arduino Bluetooth roboti 3D bosib chiqarish oson: Haqiqatan ham ochiq manbali Otto STEAM -da ochiq ta'lim berishga imkon beradi, biz Otto DIY -ni o'z sinflarida ishlatayotgan dunyoning turli ustaxonalari va maktablarining fikrlarini yig'amiz va bu o'quv joylarining ochiqligiga qarab. biz yoki
Bluetooth mobil roboti Arduino Uno va Android yordamida: 5 qadam
Bluetooth mobil roboti Arduino Uno va Android yordamida: Hamma mobil robotni yaxshi ko'radi :) Bu Maker UNO (Arduino UNO bilan mos) asosidagi mobil robot to'plami. Siz elektronika, datchiklar, mikrokontroller va kodlashni birdaniga o'rganishingiz mumkin, shunda dam olishni ham unutmaslik kerak! To'plam bo'sh qismlardan iborat, shuning uchun siz
Arduino chorva roboti (Bluetooth): 5 qadam
Arduino Pet Robot (Bluetooth): Bu robot haqida birinchi narsa - bu juda ajoyib va ajoyib. Mening RoMo bilan yoqimli munosabatlarga ega yoqimli Arduino Bluetooth uy hayvonlari roboti bilan tanishing. Robot bluetooth tuyg'usidan bahramand bo'lishi mumkin, agar yorug'lik avtomatik o'chirilgan bo'lsa, u o'z chirog'ida yonadi. Ko'proq ko'rish
MIO Moov 200 karnay rejimi: 3 qadam
MIO Moov 200 karnay rejimi: Mening asl karnayim bo'linib ketganday tuyuldi. Men uni kafolatli ta'mirlashga yubordim va 5 haftadan so'ng men uni qaytarib oldim. 2 oydan keyin, xuddi shu narsa. Men ularni boshqa POS bilan almashtirishni kutishning hojati yo'q deb qaror qildim