what servo to use for a arduino useless box

only want to give a back story get-go. So i saw this video on youtube virtually the useless box, and i thought that it would make a great souvenir for my 7 year old. And so i went out and bought everything that the guy posted in his clarification box. But want to say that i am very new to Arduino and how these things piece of work. I actually merely want to build this as a gift to my son. I know on Stack platforms that before yous inquire questions you need to effort yourself, i have been trying to get this thing working for the past 36 hours, and im not getting anywhere.

So here is a list of the things i have tried then far.

  1. Firstly i bought everything exactly the same as what the guy had, imported it and then i know its the same stuff.
  2. I downloaded the code and schematic.
  3. I wired the little lath 4 times, to brand sure i did it correctly.
  4. I accept redrawn the schematic in tinkercad to make sure all the wires are going to the correct places.

Here is the link to my tinkercad drawing the code is in there equally well. Delight note that on tinkercad i cant get the arduino board not to be plugged in by usb, it is supposed to get power from the external power supply (4AA battries).

https://world wide web.tinkercad.com/things/43WIrlmR1K3-project1

Here is a link to the youtube video: https://world wide web.youtube.com/watch?v=cpdjQ0gheDQ&t=311s

Hither is the schematic he provided:

enter image description here Hither is the Code he provided:

                      #include <Servo.h>                          Servo handServo;                           Servo boxServo;  int switchStatus=0, action=i, vot, randNumber=0;                  const int ledPin = thirteen;                     const int frontSwitchPin = ii; const int handServoPin = 5; const int boxServoPin = vi;   void setup() {   Serial.begin(9600);    pinMode(ledPin, OUTPUT);                     digitalWrite(ledPin,Loftier);    handServo.adhere(handServoPin);                 boxServo.attach(boxServoPin);   handServo.write(180);                           boxServo.write(70);    //randomSeed(analogRead(0)); }   void loop() {   switchStatus = digitalRead(frontSwitchPin);    //action = random(1,sixteen);    if (switchStatus == LOW){                         if (action == one)     {       Serial.println("Action 1");                 for (int i = 70; i <= 110; i++)       {         boxServo.write(i);         filibuster(20);       }       for (int i = 180; i >= 35; i--)       {         handServo.write(i);         delay(20);       }       delay(thou);       handServo.write(26);       filibuster(200);       for (int i = 26; i <=180; i++)       {         handServo.write(i);         delay(twenty);       }       for (int i = 110; i >= seventy; i--)       {         boxServo.write(i);         filibuster(20);       }       action++;     }       else if (activeness == 2)     {       Series.println("Action 2");                for (int i = 70; i <= 110; i++){         boxServo.write(i);         delay(half dozen);       }       delay(550);       handServo.write(26);       filibuster(550);       handServo.write(180);       delay(550);       boxServo.write(70);       delay(1500);       for (int i = 70; i <= 110; i++){         boxServo.write(i);         delay(six);       }       delay(3000);       boxServo.write(seventy);       action++;     }      else if (action == 3)     {       Serial.println("Action 3");                for (int i = 70; i <= 110; i++){         boxServo.write(i);         delay(half-dozen);       }       delay(m);       boxServo.write(70);       delay(2000);       for (int i = seventy; i <= 110; i++){         boxServo.write(i);         delay(half dozen);       }       handServo.write(26);       delay(550);       handServo.write(180);       filibuster(500);       boxServo.write(70);       action++;     }      else if (action == 4)     {       Series.println("Action iv");                for (int i = 70; i <= 110; i++)       {         boxServo.write(i);         delay(20);       }       for (int i = 180; i >= 35; i--)       {         handServo.write(i);         delay(20);       }       filibuster(2000);       handServo.write(26);       delay(200);       handServo.write(180);       delay(400);       boxServo.write(70);       action++;     }      else if (activeness == 5)     {       Series.println("Activeness 5");            for (int i = lxx; i <= 110; i++){         boxServo.write(i);         delay(6);       }       delay(2000);       handServo.write(65);       delay(550);       handServo.write(xl);       delay(200);       handServo.write(65);       delay(200);       handServo.write(40);       delay(200);       handServo.write(65);       delay(200);       handServo.write(40);       filibuster(200);       handServo.write(65);       delay(200);       handServo.write(40);       delay(200);       handServo.write(65);       delay(200);       handServo.write(xl);       filibuster(200);       handServo.write(65);       filibuster(2000);       handServo.write(26);       filibuster(400);       handServo.write(180);       delay(400);       boxServo.write(70);       action++;     }      else if (action == six)                  {       Serial.println("Activeness half-dozen");             for (int i = lxx; i <110; i++)       {         boxServo.write(i);         delay(20);       }       delay(k);       for (int i = 0; i < 12; i++)       {         for (int j = lxx; j <= 110; j++){           boxServo.write(j);           delay(vi);         }         delay(200);       }       for (int i = 180; i >= 35; i--)       {         handServo.write(i);         delay(xxx);       }       handServo.write(26);       delay(400);       handServo.write(180);       delay(400);       boxServo.write(lxx);       delay(1500);       for (int i = 70; i <= 110; i++){         boxServo.write(i);         delay(6);       }       delay(3000);       boxServo.write(lxxx);       action++;     }      else if (activeness == seven)     {       Series.println("Action vii");             for (int i = 70; i <= 110; i++){         boxServo.write(i);         filibuster(6);       }       delay(400);       handServo.write(26);       delay(thousand);       for (int i = 0; i < half dozen; i++)       {         for (int j = 70; j <= 110; j++){           boxServo.write(j);           delay(6);         }         delay(200);       }       delay(500);       handServo.write(180);       filibuster(400);       boxServo.write(seventy);       action++;     }      else if (activeness == 8)     {       Serial.println("Action 8");           for (int i = 70; i <= 110; i++){         boxServo.write(i);         delay(6);       }       handServo.write(26);       delay(2000);       for (int i = 0; i < 7; i++)       {         handServo.write(75);         delay(100);         handServo.write(40);         filibuster(100);       }       filibuster(500);       handServo.write(180);       filibuster(thousand);       boxServo.write(70);       activity++;     }      else if (activeness == 9)     {       Serial.println("Activity 9");             for (int i = 70; i <= 105; i++){         boxServo.write(i);         delay(vi);       }       delay(2000);       boxServo.write(110);       for (int i = 180; i >=35; i--)       {         handServo.write(i);         filibuster(xl);       }       filibuster(500);       handServo.write(26);       delay(200);       for (int i = 26; i <=180; i++)       {         handServo.write(i);         delay(40);       }       boxServo.write(70);       delay(2000);       boxServo.write(100);       delay(3000);       boxServo.write(70);       action++;     }       else if (action == 10)     {       Serial.println("Activity x");             for (int i = seventy; i <= 105; i++)       {         boxServo.write(i);         delay(100);       }       delay(m);       for (int i = 0; i < ten; i++)       {         for (int j = 70; j <= 100; j++){           boxServo.write(j);           delay(6);       }         delay(100);       }       boxServo.write(110);       delay(100);       handServo.write(26);       delay(650);       handServo.write(180);       delay(400);       boxServo.write(70);       action++;     }      else if (action == xi)     {       Serial.println("Activity 11");            for (int i = lxx; i <= 110; i++){         boxServo.write(i);         delay(half-dozen);       }       handServo.write(26);       filibuster(2000);       for (int i = 0; i < 3; i++)       {         handServo.write(65);         delay(200);         handServo.write(40);         filibuster(200);       }       delay(1500);       handServo.write(180);       delay(400);       boxServo.write(70);       delay(1500);       for (int i = lxx; i <= 110; i++){         boxServo.write(i);         delay(6);       }       handServo.write(26);       filibuster(3000);       handServo.write(180);       delay(400);       boxServo.write(seventy);       action++;     }      else if (activity == 12)     {       Serial.println("Activeness 12");           for (int i = 70; i <= 110; i++)       {         boxServo.write(i);         filibuster(l);       }       delay(1000);       for (int i = 180; i >= 26; i--)       {         handServo.write(i);         filibuster(fifty);       }       filibuster(2000);       handServo.write(26);       delay(200);       handServo.write(180);       delay(400);       boxServo.write(70);       action++;     }      else if (activity == 13)     {       Serial.println("Activity thirteen");            for (int i = 70; i <= 110; i++){         boxServo.write(i);         filibuster(6);       }       delay(2000);       for (int i = 180; i >= 60; i--)       {         handServo.write(i);         delay(40);       }       for (int i = 0; i < 3; i++)       {         handServo.write(threescore);         delay(200);         handServo.write(xl);         filibuster(800);       }       handServo.write(26);       filibuster(2000);       handServo.write(180);       delay(500);       boxServo.write(seventy);       action++;     }      else if (action == 14)     {       Serial.println("Action fourteen");            for (int i = seventy; i <= 105; i++){         boxServo.write(i);         delay(half-dozen);       }       filibuster(4000);       boxServo.write(110);       handServo.write(26);       delay(650);       handServo.write(180);       delay(500);       boxServo.write(100);       filibuster(4000);       boxServo.write(70);       activeness++;     }      else if (action == 15)     {       Serial.println("Action xv");          for (int i = seventy; i <= 105; i++){         boxServo.write(i);         delay(6);       }       delay(1000);       for (int i = 0; i < three; i++)       {               for (int j = 70; j <= 105; j++){           boxServo.write(j);           delay(50);         }         for (int j = 105; j >= 70; j--)         {           boxServo.write(j);           delay(50);         }       }       for (int j = 70; j <= 110; j++){         boxServo.write(j);         delay(50);       }       for (int i = 180; i >= 35; i--)       {         handServo.write(i);         delay(40);       }       filibuster(k);       handServo.write(26);       delay(400);       handServo.write(180);       filibuster(400);       boxServo.write(seventy);       action = 1;     }    }  }                  

So in my tinkercad when i run the simulation everything works (exept for the motors breaking only i know it because of the extra power its getting from the usb which i can plough off). When you look in the Serial Monitor it runs through all the "Actions" and when you simulate the push that gets pressed by the servo everthing stops and look until y'all toggle the switch again and it goes to the next activeness.

I accept done exactly the same and like i said i wired the board four times to make sure its exactly the same. When i switch on the project on my lath the servos keep spinning and does not cease and wait for the switch, but when i toggle the switch it actually plays the next "Action", simply in the times where information technology is suppose to look or cease when the switch is in the off position the servos go on rotating looks like in an anti-clockwise rotation.

Please any assistance would exist greatly appreciated. If you lot need more info or if anything is unclear please ask me to provide more than and i will. I tried to arrive as clear every bit possible. Thank you

estradachai1971.blogspot.com

Source: https://arduino.stackexchange.com/questions/70885/useless-box-wiring-and-code

0 Response to "what servo to use for a arduino useless box"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel