How to make android app for controlling multiple servo Motor using MIT app inventor

Поделиться
HTML-код
  • Опубликовано: 2 дек 2024

Комментарии • 58

  • @trainplayernate2411
    @trainplayernate2411 8 лет назад +3

    Very informative! Is there a way to take the slider and replace it with a button to move the servo to set distances rather than using the slider function?

    • @jjf0615
      @jjf0615 9 месяцев назад

      Yes there is, you can look at other videos on Bluetooth servo controlling to find how.

  • @dedesiyah5975
    @dedesiyah5975 8 лет назад +1

    thanks for this video it is really helpfull!!!but i dont understand why you send 2 byte.i mean why you need 2 byte 1 is common for all servos and 1 is the real servo that you want to control then you use both to control 1 servo by adding like this (servopos1 *256) + servopos i really need help why you need to do this

  • @rotimiawomodu1156
    @rotimiawomodu1156 2 года назад

    thanks for that. Is there any other way of representing the motors as one except using only slides

  • @JayAmielAjoc
    @JayAmielAjoc 8 лет назад +3

    can you please explain this part of the code?
    unsigned int servopos = bluetooth.read();
    unsigned int servopos1 = bluetooth.read();
    unsigned int realservo = (servopos1 *256) + servopos;
    Serial.println(realservo);
    can you please explain this part of the code?

  • @handelmande5795
    @handelmande5795 Год назад

    Thank you very much, it was very useful and helped me a lot. Well explained and detailed

  • @BlueCoreTech
    @BlueCoreTech 8 лет назад +6

    Better arduino code.
    /*
    Author: Danny van den Brande.
    With this code you can control multiple servo motors by using a android app.
    You can add as many as you like untill your pins run out. You can add more Servos in the code.
    */
    #include
    Servo myservo1, myservo2, myservo3, myservo4, myservo5, myservo6, myservo7, myservo8, myservo9, myservo10;
    byte serialA;
    void setup()
    {
    myservo1.attach(9);
    myservo2.attach(10);
    myservo3.attach(11);
    myservo4.attach(3);
    myservo5.attach(5);
    myservo6.attach(6);
    // myservo7.attach(); fill in pin numbers if you use more then 6 servos i left them blank
    // myservo8.attach();
    // myservo9.attach();
    // myservo10.attach();
    Serial.begin(9600);//change your baudrate to your Bluetooth modules baudrate if needed.
    }
    void loop()
    {
    if (Serial.available() > 2) {serialA = Serial.read();Serial.println(serialA);}
    {
    unsigned int servopos = Serial.read();
    unsigned int servopos1 = Serial.read();
    unsigned int realservo = (servopos1 *256) + servopos;
    Serial.println(realservo);
    if (realservo >= 1000 && realservo =2000 && realservo =3000 && realservo < 3180){
    int servo3 = realservo;
    servo3 = map(servo3, 3000, 3180,0,180);
    myservo3.write(servo3);
    Serial.println("servo 3 On");
    delay(10);
    }
    if (realservo >=4000 && realservo < 4180){
    int servo4 = realservo;
    servo4 = map(servo4, 4000, 4180,0,180);
    myservo4.write(servo4);
    Serial.println("servo 4 On");
    delay(10);
    }
    if (realservo >=5000 && realservo < 5180){
    int servo5 = realservo;
    servo5 = map(servo5, 5000, 5180,0,180);
    myservo5.write(servo5);
    Serial.println("servo 5 On");
    delay(10);
    }
    if (realservo >=6000 && realservo < 6180){
    int servo6 = realservo;
    servo6 = map(servo6, 6000, 6180,0,180);
    myservo6.write(servo6);
    Serial.println("servo 6 On");
    delay(10);
    }
    // if (realservo >=7000 && realservo < 7180){ //UNCOMMENT if using more then 6 Servos.
    // int servo7 = realservo;
    // servo7 = map(servo7, 7000, 7180,0,180);
    // myservo7.write(servo7);
    // Serial.println("servo 7 On");
    // delay(10);
    // }
    //
    // if (realservo >=8000 && realservo < 8180){
    // int servo8 = realservo;
    // servo8 = map(servo8, 8000, 8180,0,180);
    // myservo8.write(servo8);
    // Serial.println("servo 8 On");
    // delay(10);
    // }
    //
    // if (realservo >=9000 && realservo < 9180){
    // int servo8 = realservo;
    // servo8 = map(servo9, 9000, 9180,0,180);
    // myservo8.write(servo8);
    // Serial.println("servo 9 On");
    // delay(10);
    // }
    //
    // if (realservo >=10000 && realservo < 10180){
    // int servo10 = realservo;
    // servo10 = map(servo10, 10000, 10180,0,180);
    // myservo10.write(servo10);
    // Serial.println("servo 10 On");
    // delay(10);
    // }
    }
    }

    • @GutteDgrowls
      @GutteDgrowls 7 лет назад +1

      Does it works with the same kind of app? or you need to change something in the app?

  • @EricSchreiber
    @EricSchreiber 7 лет назад

    Do you have any instructions on how to update the FTC Robot Controller in AppInventor? (The version in my AppInventor is not compatible with REV Expansion Hub)

  • @alexandranixu5272
    @alexandranixu5272 6 лет назад

    When you added the bluetooth, you also added a clock. Can you please explain what is that for? ty

  • @JayAmielAjoc
    @JayAmielAjoc 8 лет назад +1

    sir can you make a tutorial on an apk that can control two servos for pan/tilt with a dpad interface?

  • @fer9621
    @fer9621 6 лет назад

    please i need konoy as connect bluetooth couse when open app ahow a text that say "error connected" How do I connect the app to bluetooth since I do not get any devices or the list is hidden?

  • @bhargavpurohit4577
    @bhargavpurohit4577 7 лет назад +3

    sir can u give me aia file of apk..

  • @codtougee3088
    @codtougee3088 5 лет назад

    Hello. Sir what if. Multiple servo using click button not a slider? Please help

  • @DennisDay58
    @DennisDay58 5 лет назад

    Does anyone know what the bluetooth pairing request PIN is on Android for this? I am using Bluno uno mini (has booth tooth built in)

  • @Isotope1213
    @Isotope1213 8 лет назад +1

    whats the 256? I am just tying to understand the math here

  • @romeohayven22998
    @romeohayven22998 Год назад

    Error:515 Not connected to Bluetooth module
    .
    Why is that happening ???

  • @panzerfahrer6933
    @panzerfahrer6933 Год назад

    When I want to use the app, I get Error 516 unable to write: broken pipe. I don't really know what to do.

  • @alt-ht2wq
    @alt-ht2wq 8 лет назад

    hi! i have arduino due...i can't upload the program...can you help me with a program(and a sketch if you can) please :( i have only 3 servos...

  • @kennydedavion
    @kennydedavion 4 года назад

    Hi, great tutorial. Can I ask for help writing code with module pca9685? do not understand the conversion of 1000 and it is difficult for me to send such values. Is it possible to solve it by strengthening two variables, one for servo, the other for angle? Thank you for your help

  • @davidaubry5718
    @davidaubry5718 2 года назад

    where i find the arduino code plz

  • @LovKushBrothers
    @LovKushBrothers 6 лет назад

    ITS very helpful thanks for your education keep it up !

  • @GauravKumar-oi4xp
    @GauravKumar-oi4xp Год назад

    Will u please share the code sir

  • @vincentjonathan8381
    @vincentjonathan8381 4 года назад

    error could not decode as an integer

  • @danielvelasquez1491
    @danielvelasquez1491 8 лет назад

    excelente amigo, gracias!!! esto lo he estado buscando desde hace mucho, le corregí algunas cosas y me funciona perfecto (Y)

    • @renanzeidpereztoledo7735
      @renanzeidpereztoledo7735 8 лет назад

      disculpe pero esta super si, me puede aser el favor esque necesito el programa para esa app

    • @danielvelasquez1491
      @danielvelasquez1491 8 лет назад +1

      si claro, pero en si yo lo hice funcionar con un solo servo debo aclarar que use un modulo hc-05 el programa en arduino es:
      #include
      #include
      Servo servo;
      int btltx =7; //en esta parte la conexión es exactamente igual tx con tx
      int btlrx =8;
      SoftwareSerial bluetooth(btltx,btlrx);
      void setup() {
      servo.attach(3);
      Serial.begin(9600);
      bluetooth.begin(38400);
      }
      void loop() {
      if(bluetooth.available()>0){
      int servopos = bluetooth.read();
      Serial.println(servopos);
      servo.write(servopos);
      }
      }
      junto con esto le dejo el link del vídeo donde este mismo autor describe el programa en arduino y el app. si usted quiere mover los mas de tres servos en este vídeo esta muy explicito solo debe verificar a través del monitor serial cuanto es la salida junto con eso se entiende el por que del 256.
      espero le sea útil.

    • @marwaboukechi4585
      @marwaboukechi4585 3 года назад

      @@danielvelasquez1491 please can you help me
      I have problems with the code
      My arm robot start working than shut down alone
      I think the program is not well adapted

  • @philipp3411
    @philipp3411 9 лет назад

    nice vid dude...would you mind to make an external one about the arduino setup for bluetooth? would be awesome!:)
    left a like;)

  • @MrNwathan
    @MrNwathan 5 лет назад

    The code doesn't work you must do the -1000 away and then it will work!

  • @nitingamare9693
    @nitingamare9693 5 лет назад

    can anyone tell me ,,after devloping app how to download apk ,,in mit app inventor

  • @Dinu0623
    @Dinu0623 Год назад

    I need this code please bro😭😭

  • @TryingTogether
    @TryingTogether 8 лет назад

    After a while the app stuck.Why this happens?Can you please explain?

  • @yashikasinghal1345
    @yashikasinghal1345 5 лет назад

    Anyone plzz tell where is code

  • @travisl6654
    @travisl6654 8 лет назад

    why does my other servos jerk around when i try to move one of them? =(

    • @TryingTogether
      @TryingTogether 8 лет назад +2

      +Travis D It is problem code.Remove the softwareserial from the code.I had this problem also.

    • @travisl6654
      @travisl6654 8 лет назад

      Δημήτρης Βλαχοσπύρος lol yea I figured it out few days later. It was frustrating haha thanks!

    • @BlueCoreTech
      @BlueCoreTech 8 лет назад +1

      +Travis D
      Here i wrote a better code.
      /*
      Author: Danny van den Brande.
      With this code you can control multiple servo motors by using a android app.
      You can add as many as you like untill your pins run out. You can add more Servos in the code.
      */
      #include
      Servo myservo1, myservo2, myservo3, myservo4, myservo5, myservo6, myservo7, myservo8, myservo9, myservo10;
      byte serialA;
      void setup()
      {
      myservo1.attach(9);
      myservo2.attach(10);
      myservo3.attach(11);
      myservo4.attach(3);
      myservo5.attach(5);
      myservo6.attach(6);
      // myservo7.attach(); fill in pin numbers if you use more then 6 servos i left them blank
      // myservo8.attach();
      // myservo9.attach();
      // myservo10.attach();
      Serial.begin(9600);//change your baudrate to your Bluetooth modules baudrate if needed.
      }
      void loop()
      {
      if (Serial.available() > 2) {serialA = Serial.read();Serial.println(serialA);}
      {
      unsigned int servopos = Serial.read();
      unsigned int servopos1 = Serial.read();
      unsigned int realservo = (servopos1 *256) + servopos;
      Serial.println(realservo);
      if (realservo >= 1000 && realservo =2000 && realservo =3000 && realservo < 3180){
      int servo3 = realservo;
      servo3 = map(servo3, 3000, 3180,0,180);
      myservo3.write(servo3);
      Serial.println("servo 3 On");
      delay(10);
      }
      if (realservo >=4000 && realservo < 4180){
      int servo4 = realservo;
      servo4 = map(servo4, 4000, 4180,0,180);
      myservo4.write(servo4);
      Serial.println("servo 4 On");
      delay(10);
      }
      if (realservo >=5000 && realservo < 5180){
      int servo5 = realservo;
      servo5 = map(servo5, 5000, 5180,0,180);
      myservo5.write(servo5);
      Serial.println("servo 5 On");
      delay(10);
      }
      if (realservo >=6000 && realservo < 6180){
      int servo6 = realservo;
      servo6 = map(servo6, 6000, 6180,0,180);
      myservo6.write(servo6);
      Serial.println("servo 6 On");
      delay(10);
      }
      // if (realservo >=7000 && realservo < 7180){ //UNCOMMENT if using more then 6 Servos.
      // int servo7 = realservo;
      // servo7 = map(servo7, 7000, 7180,0,180);
      // myservo7.write(servo7);
      // Serial.println("servo 7 On");
      // delay(10);
      // }
      //
      // if (realservo >=8000 && realservo < 8180){
      // int servo8 = realservo;
      // servo8 = map(servo8, 8000, 8180,0,180);
      // myservo8.write(servo8);
      // Serial.println("servo 8 On");
      // delay(10);
      // }
      //
      // if (realservo >=9000 && realservo < 9180){
      // int servo8 = realservo;
      // servo8 = map(servo9, 9000, 9180,0,180);
      // myservo8.write(servo8);
      // Serial.println("servo 9 On");
      // delay(10);
      // }
      //
      // if (realservo >=10000 && realservo < 10180){
      // int servo10 = realservo;
      // servo10 = map(servo10, 10000, 10180,0,180);
      // myservo10.write(servo10);
      // Serial.println("servo 10 On");
      // delay(10);
      // }
      }
      }

    • @TryingTogether
      @TryingTogether 8 лет назад

      Thank you very much for your code

    • @BlueCoreTech
      @BlueCoreTech 8 лет назад

      +Δημήτρης Βλαχοσπύρος No problem

  • @gurkanturk3012
    @gurkanturk3012 9 лет назад +1

    unsigned int servopos = Serial.read();
    unsigned int servopos1 = Serial.read();
    unsigned int realservo = (servopos1 *256) + servopos;
    Serial.println(realservo);
    I dont understand u are doing :/

  • @marwaboukechi4585
    @marwaboukechi4585 3 года назад

    SIR THANK YOU FOR THIS AWSOME VIDEO§ PLEASE CAN YOU HELP ME TO ADD BUTTTONS TO CONTROL SIMULTANIOUSLY 4 SERVOS AND A 4W CAR!

  • @AvinashBhashkar
    @AvinashBhashkar 7 лет назад

    nice great tutorials

  • @hasanyalcinarikanoglu
    @hasanyalcinarikanoglu 8 лет назад

    nice job dude

  • @activedrive8310
    @activedrive8310 4 года назад

    Thank you!

  • @joelarellanodelacruz7286
    @joelarellanodelacruz7286 2 года назад

    7 años después sigue funcionando xd

  • @kdeepanshu
    @kdeepanshu Год назад

    Bhai is video ko hindi main bana lo

  • @fear37281
    @fear37281 4 года назад

    good crack video helped me a lot