İçindekiler:

Robotik Kol Oyunu - Akıllı Telefon Kumandası: 6 Adım
Robotik Kol Oyunu - Akıllı Telefon Kumandası: 6 Adım

Video: Robotik Kol Oyunu - Akıllı Telefon Kumandası: 6 Adım

Video: Robotik Kol Oyunu - Akıllı Telefon Kumandası: 6 Adım
Video: Tuşlu Telefondan roblox açıyoruz 😯 2024, Temmuz
Anonim
Robotik Kol Oyunu - Akıllı Telefon Kumandası
Robotik Kol Oyunu - Akıllı Telefon Kumandası

Merhaba !

İşte eğlenceli bir yaz oyunu: Akıllı telefon tarafından kontrol edilen robotik Kol !!

Videoda da görebileceğiniz gibi, akıllı telefonunuzdaki bazı Joystick'ler ile Kolu kontrol edebilirsiniz.

Ayrıca, örnek olarak bazı tekrarlayan görevleri yapmak için robotun bir döngü içinde yeniden oluşturacağı bir desen kaydedebilirsiniz. Ama bu desen istediğiniz gibi modüle edilebilir !!!!

Yaratıcı ol !

Adım 1: Malzemeler

Malzemeler
Malzemeler

Burada ihtiyacınız olan malzemeyi görebilirsiniz.

Bu robotik Kolu inşa etmek size yaklaşık 50€'ya mal olacak. Yazılım ve araçlar değiştirilebilir, ancak bunları bu proje için kullandım.

2. Adım: Robotik Kolu 3D Bastırın

Robotik Kolu 3D Yazdır
Robotik Kolu 3D Yazdır
Robotik Kolu 3D Yazdır
Robotik Kolu 3D Yazdır
Robotik Kolu 3D Yazdır
Robotik Kolu 3D Yazdır

Robotik Kol 3D olarak basıldı (prusa i3'ümüzle).

"HowtoMechatronics.com" web sitesi sayesinde, STL Dosyaları bir 3D kol oluşturmak için harika.

Tüm parçaları yazdırmak yaklaşık 20 saat sürecektir.

Adım 3: Elektronik Montaj

Elektronik Montaj
Elektronik Montaj

Montaj 2 kısımdır:

Arduino'nun Dijital Pinler ve Bluetooth cihazı (Rx, Tx) ile servolara bağlandığı elektronik bir parça.

Servolara 2 telefon şarj cihazı (5V, 2A maks) ile güç verildiği bir Güç bölümü.

4. Adım: Akıllı Telefon Uygulaması

Akıllı Telefon Uygulaması
Akıllı Telefon Uygulaması

Uygulama, Uygulama mucidi 2'de yapıldı. 4 Servoyu kontrol etmek için 2 Joystick ve son Grip'i kontrol etmek için 2 Düğme daha kullanıyoruz.

Bir Bluetooth modülü (HC-06) kullanarak Arm ve Smartphone'u birbirine bağlarız.

Son olarak, bir kaydetme modu, kullanıcının Kol için 9 pozisyona kadar kaydetmesine izin verir.

Kol daha sonra otomatik moda geçecek ve kaydedilen pozisyonları yeniden oluşturacaktır.

Adım 5: Arduino Kodu

Arduino Kodu
Arduino Kodu
Arduino Kodu
Arduino Kodu

// 08/19 - Robotik Kol Akıllı Telefon kontrollü

#include #define DOĞRU doğru #define YANLIŞ yanlış //********************BEYANLAR***************** ***********

kelime temsilcisi; // mot envoyé du modülü Arduino veya akıllı telefon

int chiffre_final = 0; int cmd=3; // değişken komuta du servo moteur (troisième fil (turuncu, jaune)) int cmd1=5; // servo1 int cmd2=9; // servo2 int cmd3=10; // servo3 //int cmd4=10; //servo4 int cmd5=11; // pince int activate_saving = 0; Servo motor; // tanımsız olarak servomoteur Servo moteur1; Servo motor2; Servo motor3; //Servo moteur4; Servo motor5; int step_angle_mini = 4; int adım_açı = 3; int açı, açı1, açı3, açı5, açı2;//açı int pas; int r, r1, r2, r3; int kaydedici; boole yüzgeci = YANLIŞ; boolean fin1 = YANLIŞ; boolean fin2 = YANLIŞ; boole fin3 = YANLIŞ; boole fin4 = YANLIŞ; w kelimesi; // değişken envoyé du akıllı telefon au modülü Arduino int sauvegarde_positions1[5]; int sauvegarde_positions2[5]; int sauvegarde_positions3[5]; int sauvegarde_positions4[5]; int sauvegarde_positions5[5]; int sauvegarde_positions6[5]; int sauvegarde_positions7[5]; int sauvegarde_positions8[5]; int sauvegarde_positions9[5];

//int açı; // dönüş açısı (0 a 180)

//********************KURMAK*************************** ******** void setup() { sauvegarde_positions1[0] = sauvegarde_positions1[1] = sauvegarde_positions1[2] = sauvegarde_positions1[3] = sauvegarde_positions1[4] = 0; sauvegarde_positions2[0] = sauvegarde_positions2[1] = sauvegarde_positions2[2] = sauvegarde_positions2[3] = sauvegarde_positions2[4] = 0; sauvegarde_positions3[0] = sauvegarde_positions3[1] = sauvegarde_positions3[2] = sauvegarde_positions3[3] = sauvegarde_positions3[4] = 0; sauvegarde_positions4[0] = sauvegarde_positions4[1] = sauvegarde_positions4[2] = sauvegarde_positions4[3] = sauvegarde_positions4[4] = 0; sauvegarde_positions5[0] = sauvegarde_positions5[1] = sauvegarde_positions5[2] = sauvegarde_positions5[3] = sauvegarde_positions5[4] = 0; sauvegarde_positions6[0] = sauvegarde_positions6[1] = sauvegarde_positions6[2] = sauvegarde_positions6[3] = sauvegarde_positions6[4] = 0; sauvegarde_positions7[0] = sauvegarde_positions7[1] = sauvegarde_positions7[2] = sauvegarde_positions7[3] = sauvegarde_positions7[4] = 0; sauvegarde_positions8[0] = sauvegarde_positions8[1] = sauvegarde_positions8[2] = sauvegarde_positions8[3] = sauvegarde_positions8[4] = 0; sauvegarde_positions9[0] = sauvegarde_positions9[1] = sauvegarde_positions9[2] = sauvegarde_positions9[3] = sauvegarde_positions9[4] = 0; moteur.attach(cmd); // güvenilen nesneye ve komuta moteur1.attach(cmd1); moteur2.attach(cmd2); moteur3.attach(cmd3); // moteur4.attach(cmd4); moteur5.attach(cmd5); moteur.write(6); açı = 6; moteur1.write(100); açı1 = 100; moteur2.write(90); moteur3.write(90); //moteur4.write(12); moteur5.write(90); açı=6; açı1=100; açı2= 90; açı3=90; açı5=90; Seri.başla(9600); // Bluetooth uyumlu iletişim modülü } //******************** BUCLE****************** ******************** geçersiz döngü() {

// Seri.print (" açı");

//Serial.print(açı);Serial.print (" \t");Serial.print(angle1);Serial.print (" \t");Serial.print(angle2);Serial.print (" \t ");Serial.print(angle3);Serial.print (" \t");Serial.print(angle5);Serial.print (" \n");

//Serial.print("açı");

int i; w=alıcı(); // akıllı telefondan alınan bilgilerde, la değişken w anahtarı (w) { durum 1: TouchDown_Release();break; durum 2: TouchDown_Grab();break; durum 3: Base_Rotation();break; durum 4: Base_AntiRotation();break; durum 5: Waist_Rotation();break; durum 6: Waist_AntiRotation();break; durum 7: Third_Arm_Rotation();break; durum 8: Third_Arm_AntiRotation();break; durum 9: Fourth_Arm_Rotation();break; durum 10: Fourth_Arm_AntiRotation();break; //durum 11: Fifth_Arm_Rotation();break; //durum 12: Fifth_Arm_AntiRotation();break; durum 21: Serial.print("durum düğmesi 1 ");chiffre_final = 1;sauvegarde_positions1[0] =angle;sauvegarde_positions1[1] =angle1;sauvegarde_positions1[2] =angle2;sauvegarde_positions1[3] =angle3;sauvegarde_positions =angle5;Serial.println(sauvegarde_positions1[1]);Serial.println(sauvegarde_positions1[2]);Serial.println(sauvegarde_positions1[3]);Serial.println(sauvegarde_positions1[4]); kırmak; durum 22: chiffre_final = 2;sauvegarde_positions2[0] =angle;sauvegarde_positions2[1] =angle1;sauvegarde_positions2[2] =angle2;sauvegarde_positions2[3] =angle3;sauvegarde_positions2[4] =angle5; kırmak; durum 23: chiffre_final = 3;sauvegarde_positions3[0] =angle;sauvegarde_positions3[1] =angle1;sauvegarde_positions3[2] =angle2;sauvegarde_positions3[3] =angle3;sauvegarde_positions3[4] =angle5;break; durum 24: chiffre_final = 4;sauvegarde_positions4[0] =angle;sauvegarde_positions4[1] =angle1;sauvegarde_positions4[2] =angle2;sauvegarde_positions4[3] =angle3;sauvegarde_positions4[4] =angle5; kırmak; durum 25: chiffre_final = 5;sauvegarde_positions5[0] =angle;sauvegarde_positions5[1] =angle1;sauvegarde_positions5[2] =angle2;sauvegarde_positions5[3] =angle3;sauvegarde_positions5[4] =angle5; kırmak; durum 26: chiffre_final = 6;sauvegarde_positions6[0] =angle;sauvegarde_positions6[1] =angle1;sauvegarde_positions6[2] =angle2;sauvegarde_positions6[3] =angle3;sauvegarde_positions6[4] =angle5; kırmak; durum 27: chiffre_final = 7;sauvegarde_positions7[0] =angle;sauvegarde_positions7[1] =angle1;sauvegarde_positions7[2] =angle2;sauvegarde_positions7[3] =angle3;sauvegarde_positions7[4] =angle5; kırmak; durum 28: chiffre_final = 8;sauvegarde_positions8[0] =angle;sauvegarde_positions8[1] =angle1;sauvegarde_positions8[2] =angle2;sauvegarde_positions8[3] =angle3;sauvegarde_positions8[4] =angle5; kırmak; durum 29: chiffre_final = 9;sauvegarde_positions9[0] =angle;sauvegarde_positions9[1] =angle1;sauvegarde_positions9[2] =angle2;sauvegarde_positions9[3] =angle3;sauvegarde_positions9[4] =angle5; kırmak;

durum 31: Serial.print("31");activate_saving = 1;chiffre_final = 0; ara;// BAŞLA

durum 33: Serial.print("33");activate_saving = 0; break;// BUTTON SAVE default: break; } if(w == 32) { Serial.print("\nReproduce\nChiffre final: "); Serial.print(chiffre_final); Serial.print("\n Sauvegarde konum 1: \n"); for(i=0;i<5;i++){ Serial.print(sauvegarde_positions1);Serial.print("\t");} Serial.print("\n Sauvegarde konum 2: \n"); for(i=0;i<5;i++){ Serial.print(sauvegarde_positions2);Serial.print("\t");} Serial.print("\n Sauvegarde konum 3: \n"); for(i=0;i<5;i++){ Serial.print(sauvegarde_positions3);Serial.print("\t");} for (i = 1;i<=chiffre_final;i++) { Seri. print(" \n\n BAŞLA \nDöngü: "); Seri.print(i);Serial.print("\n"); switch(i) { durum 1: goto_moteur(*(sauvegarde_positions1));delay(200); goto_moteur1(*(sauvegarde_positions1+1)); gecikme(200); goto_moteur2(*(sauvegarde_positions1+2));delay(200); goto_moteur3(*(sauvegarde_positions1+3)); gecikme(200); goto_moteur5(*(sauvegarde_positions1+4));delay(200); kırmak; durum 2: goto_moteur(*(sauvegarde_positions2));delay(200); goto_moteur1(*(sauvegarde_positions2+1)); gecikme(200); goto_moteur2(*(sauvegarde_positions2+2));delay(200); goto_moteur3(*(sauvegarde_positions2+3)); gecikme(200); goto_moteur5(*(sauvegarde_positions2+4));delay(200); kırmak; durum 3: goto_moteur(*(sauvegarde_positions3));delay(200); goto_moteur1(*(sauvegarde_positions3+1)); gecikme(200); goto_moteur2(*(sauvegarde_positions3+2));delay(200); goto_moteur3(*(sauvegarde_positions3+3)); gecikme(200); goto_moteur5(*(sauvegarde_positions3+4));delay(200); kırmak; durum 4: goto_moteur(*(sauvegarde_positions4));delay(200); goto_moteur1(*(sauvegarde_positions4+1)); gecikme(200); goto_moteur2(*(sauvegarde_positions4+2));delay(200); goto_moteur3(*(sauvegarde_positions4+3)); gecikme(200); goto_moteur5(*(sauvegarde_positions4+4));delay(200); kırmak; durum 5: goto_moteur(*(sauvegarde_positions5));delay(200); goto_moteur1(*(sauvegarde_positions5+1)); gecikme(200); goto_moteur2(*(sauvegarde_positions5+2));delay(200); goto_moteur3(*(sauvegarde_positions5+3)); gecikme(200); goto_moteur5(*(sauvegarde_positions5+4));delay(200); kırmak; durum 6: goto_moteur(*(sauvegarde_positions6));delay(200); goto_moteur1(*(sauvegarde_positions6+1)); gecikme(200); goto_moteur2(*(sauvegarde_positions6+2));delay(200); goto_moteur3(*(sauvegarde_positions6+3)); gecikme(200); goto_moteur5(*(sauvegarde_positions6+4));delay(200); kırmak; durum 7: goto_moteur(*(sauvegarde_positions7));delay(200); goto_moteur1(*(sauvegarde_positions7+1)); gecikme(200); goto_moteur2(*(sauvegarde_positions7+2));delay(200); goto_moteur3(*(sauvegarde_positions7+3)); gecikme(200); goto_moteur5(*(sauvegarde_positions7+4));delay(200); kırmak; durum 8: goto_moteur(*(sauvegarde_positions8));delay(200); goto_moteur1(*(sauvegarde_positions8+1)); gecikme(200); goto_moteur2(*(sauvegarde_positions8+2));delay(200); goto_moteur3(*(sauvegarde_positions8+3)); gecikme(200); goto_moteur5(*(sauvegarde_positions8+4));delay(200); kırmak; durum 9: goto_moteur(*(sauvegarde_positions9));delay(200); goto_moteur1(*(sauvegarde_positions9+1)); gecikme(200); goto_moteur2(*(sauvegarde_positions9+2));delay(200); goto_moteur3(*(sauvegarde_positions9+3)); gecikme(200); goto_moteur5(*(sauvegarde_positions9+4));delay(200); kırmak; } Serial.print("\n*********************** FIN REPRODUCE ******************** \n "); gecikme(500); } } /*Serial.print ("ilk\n"); Seri.print(sauvegarde_positions1[0]);Serial.print (" \t");Serial.print(sauvegarde_positions1[1]);Serial.print (" \t");Serial.print(sauvegarde_positions1[2]); Seri.print (" \t");Serial.print(sauvegarde_positions1[3]);Serial.print (" \t");Serial.print(sauvegarde_positions1[4]);Serial.print (" \n"); Seri.print(sauvegarde_positions2[0]);Serial.print (" \t");Serial.print(sauvegarde_positions2[1]);Serial.print (" \t");Serial.print(sauvegarde_positions2[2]); Seri.print (" \t");Serial.print(sauvegarde_positions2[3]);Serial.print (" \t");Serial.print(sauvegarde_positions2[4]);Serial.print (" \n"); Seri.print(sauvegarde_positions3[0]);Serial.print (" \t");Serial.print(sauvegarde_positions3[1]);Serial.print (" \t");Serial.print(sauvegarde_positions3[2]); Seri.print (" \t");Serial.print(sauvegarde_positions3[3]);Serial.print (" \t");Serial.print(sauvegarde_positions3[4]);Serial.print (" \n"); Seri.print(sauvegarde_positions4[0]);Serial.print (" \t");Serial.print(sauvegarde_positions4[1]);Serial.print (" \t");Serial.print(sauvegarde_positions4[2]); Seri.print (" \t");Serial.print(sauvegarde_positions4[3]);Serial.print (" \t");Serial.print(sauvegarde_positions4[4]);Serial.print (" \n");

Serial.print("\nfin\n");*/

gecikme(100); } //******************************FONKSİYONLAR****************** ******************

kelime recevoir() { // fonction permettant de recevoir l'information du akıllı telefon

if (Serial.available()) { w = Seri.read();

Seri.flush();

dönüş w; }}

void goto_moteur(int angle_destination)

{ while (angle_destination angle+step_angle) { Serial.print(" \n --------------* * * * * *-------------- ----\n"); Serial.print("angle_hedef = \t "); Serial.print(açı_hedef); Serial.print("\n angle1 = \t ");Serial.print(açı); if(angle_hedef açısı +adım_açı){ açı = açı + adım_açı;moteur.write(açı);} gecikme(100); } moteur.write(açı_hedef); } void goto_moteur1(int angle_destination) { while (angle_destination angle1+step_angle) { Serial.print(" \n --------------* * * * * *------- -----------\n"); Serial.print("angle_hedef = \t "); Serial.print(açı_hedef); Seri.print("\n açı2 = \t ");Seri.baskı(açı1); if(angle_destination angle1 +step_angle){angle1 += step_angle; moteur1.write(angle1);;} gecikme(100); } moteur1.write(açı_hedef); } void goto_moteur2(int angle_destination) {

while (açı_hedef açısı2+adım_açı)

{ Serial.print(" \n --------------* * * * * *----------------\n"); Serial.print("angle_hedef = \t "); Serial.print(açı_hedef); Serial.print("\n angle3 = \t ");Serial.print(angle2); if(angle_hedef açısı2 +adım_açı){angle2+=adım_açı; moteur2.write(angle2);} gecikme(100); } moteur2.write(açı_hedef); } void goto_moteur3(int angle_destination) {

while (angle_hedef açısı3+adım_açı)

{ Serial.print(" \n --------------* * * * * *----------------\n"); Serial.print("angle_hedef = \t "); Serial.print(açı_hedef); Seri.print("\n açı4 = \t ");Seri.baskı(açı3); if(angle_destination angle3 +step_angle){angle3+=step_angle; moteur3.write(angle3);} gecikme(100); } moteur3.write(açı_hedef); } void goto_moteur5(int angle_destination) {

while (angle_hedef açısı5+adım_açı)

{ Serial.print(" \n --------------* * * * * *----------------\n"); Serial.print("angle_hedef = \t "); Serial.print(açı_hedef); Seri.print("\n açı5 = \t ");Seri.baskı(açı5); if(angle_destination angle5 +step_angle){angle5+=step_angle; moteur5.write(açı5);} gecikme(100); } moteur5.write(açı_hedef); }

void TouchDown_Release() // TouchDown Düğmesini Bırakma

{ if (açı5 < 180) { açı5 = açı5+adım_açı_mini; } moteur5.write(açı5); }

void TouchDown_Grab() // TouchDown Düğmesi Tutma

{ if (açı5 > 0) { açı5 = açı5-adım_açı_mini; } moteur5.write(açı5); } void Base_Rotation() { if (açı 0) { açı = açı-adım_açı; } başka açı =0; moteur.write(açı); } void Waist_Rotation() { if (açı1 20) { açı1 = açı1-adım_açı; } başka açı1 = 20; moteur1.write(açı1); } void Third_Arm_Rotation() { if (açı2 0) { açı2 = açı2-adım_açı; } moteur2.write(açı2); } void Fourth_Arm_Rotation() { if (angle3 = 0) { angle3 = angle3-step_angle_mini; } moteur3.write(açı3); }

Adım 6: İşte Bu

İzlediğiniz için teşekkürler, umarım takdir etmişsinizdir!

Bu Eğitilebilir Yazıyı beğendiyseniz, kesinlikle daha fazlası için bizi ziyaret edebilirsiniz! =)

Önerilen: