Google Android: 4 Leg – 8 Servo Arduino Walking Robot

Google Android:

#walking Robotic #arduino #eight servo #bluetooth #android

Google Android: Step 1: Formula

1) micro servo 9g – 8pcs

2) Arduino nano – 1pcs

Three) hc-04 bluetooth module

four) pin headers

5) pcb board

6) extremely sonic sensor

Google Android: Step 2: Code , App and Sketch

Bluetooth module connections:

*arduino Rx to Bluetooth module Tx

*arduino Tx to Bluetooth module Rx

****************************************

Code:

****************************************

#embody

int servoPin12 = 12; int servoPin11=11; int servoPin10=10; int servoPin9=9; int servoPin8=eight; int servoPin7=7; int servoPin6=6; int servoPin5=5; const int trigPin = Three; const int echoPin = four; int Autoflag=Zero; long duration; int distance;

String readString; Servo servo12; Servo servo11; Servo servo10; Servo servo9; Servo servo8; Servo servo7; Servo servo6; Servo servo5; void setup() { servo12.connect(servoPin12); servo11.connect(servoPin11); servo10.connect(servoPin10); servo9.connect(servoPin9); servo8.connect(servoPin8); servo7.connect(servoPin7); servo6.connect(servoPin6); servo5.connect(servoPin5); pinMode(trigPin, OUTPUT); // Models the trigPin as an Output pinMode(echoPin, INPUT); // Models the echoPin as an Enter Serial.launch(9600); } void loop() { //rotate whereas(Serial.readily available()){ // the code right here is for bluetooth extend(Three); char c = Serial.be taught(); readString += c; } if(readString.size() > Zero){ // when a certain button is pressed the response shall be… Serial.println(readString); if(readString == “for”) { //foward servo8.write(50);//eight,7 step forward servo7.write(one hundred); extend(300); servo12.write(60);//12,11 step foward servo11.write(140); extend(300); servo6.write(one hundred);//6,5 step forward servo5.write(eighty);

extend(300); servo10.write(one hundred);//10,9 step forward servo9.write(forty); extend(300); //

servo12.write(one hundred thirty);//12,11 conclude servo11.write(60); servo8.write(one hundred);//eight,7 conclude servo7.write(180); servo6.write(50);//6,5 conclude servo5.write(Zero); servo10.write(50);//10,9 step forward servo9.write(a hundred and twenty); //

extend(300); // } if(readString == “assist”) { servo8.write(50);//eight,7 step forward servo7.write(180); extend(300); servo12.write(60);//12,11 step foward servo11.write(60); extend(300); servo6.write(one hundred);//6,5 step forward servo5.write(Zero);

extend(300); servo10.write(one hundred);//10,9 step forward servo9.write(a hundred and twenty); extend(300); //

servo12.write(one hundred thirty);//12,11 conclude servo11.write(140); servo8.write(one hundred);//eight,7 conclude servo7.write(one hundred); servo6.write(50);//6,5 conclude servo5.write(eighty); servo10.write(50);//10,9 step forward servo9.write(a hundred and twenty); //

extend(300); } if(readString == “left”) { servo8.write(50);//eight,7 step forward servo7.write(one hundred); extend(300); servo10.write(one hundred);//10,9 step forward servo9.write(forty); extend(300); // servo12.write(one hundred thirty);//12,11 conclude servo11.write(60); servo6.write(50);//6,5 conclude servo5.write(Zero); servo8.write(one hundred);//eight,7 conclude servo7.write(180); servo10.write(50);//10,9 step forward servo9.write(a hundred and twenty); extend(300); } if(readString == “honest”){ servo12.write(60);//12,11 step foward servo11.write(140); extend(300); servo6.write(one hundred);//6,5 step forward servo5.write(eighty); extend(300); // servo12.write(one hundred thirty);//12,11 conclude servo11.write(60); servo6.write(50);//6,5 conclude servo5.write(Zero); servo8.write(one hundred);//eight,7 conclude servo7.write(180); servo10.write(50);//10,9 step forward servo9.write(a hundred and twenty); extend(300); } if(readString == “auto”) { Autoflag=1; whereas(Autoflag!=Zero) { if(readString == “offauto”) { Autoflag=Zero; damage; } // Clears the trigPin digitalWrite(trigPin, LOW); delayMicroseconds(2); // Models the trigPin on HIGH pronounce for 10 micro seconds digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); // Reads the echoPin, returns the sound wave whisk time in microseconds duration = pulseIn(echoPin, HIGH); // Calculating the space distance= duration*Zero.034/2; // Prints the space on the Serial Video display Serial.print(“Distance: “); Serial.println(distance); extend(200); if(distance>one hundred and five) { //foward servo8.write(50);//eight,7 step forward servo7.write(one hundred); extend(300); servo12.write(60);//12,11 step foward servo11.write(140); extend(300); servo6.write(one hundred);//6,5 step forward servo5.write(eighty);

extend(300); servo10.write(one hundred);//10,9 step forward servo9.write(forty); extend(300); //

servo12.write(one hundred thirty);//12,11 conclude servo11.write(60); servo8.write(one hundred);//eight,7 conclude servo7.write(180); servo6.write(50);//6,5 conclude servo5.write(Zero); servo10.write(50);//10,9 step forward servo9.write(a hundred and twenty); //

extend(300); // if(readString == “offauto”) { Autoflag=Zero; damage; } } if(distance

extend(300); servo10.write(one hundred);//10,9 step forward servo9.write(a hundred and twenty); extend(300); //

servo12.write(one hundred thirty);//12,11 conclude servo11.write(140); servo8.write(one hundred);//eight,7 conclude servo7.write(one hundred); servo6.write(50);//6,5 conclude servo5.write(eighty); servo10.write(50);//10,9 step forward servo9.write(a hundred and twenty); //

extend(300); if(readString == “offauto”) { Autoflag=Zero; damage; } } if(distance<=105 && distance>=Ninety five) { servo12.write(one hundred thirty);//12,11 conclude servo11.write(60); servo8.write(one hundred);//eight,7 conclude servo7.write(180); servo6.write(50);//6,5 conclude servo5.write(Zero); servo10.write(50);//10,9 step forward servo9.write(a hundred and twenty); if(readString == “offauto”) { Autoflag=Zero; damage; } } if(distance>200) { servo8.write(50);//eight,7 step forward servo7.write(one hundred); extend(300); servo10.write(one hundred);//10,9 step forward servo9.write(forty); extend(300); // servo12.write(one hundred thirty);//12,11 conclude servo11.write(60); servo6.write(50);//6,5 conclude servo5.write(Zero); servo8.write(one hundred);//eight,7 conclude servo7.write(180); servo10.write(50);//10,9 step forward servo9.write(a hundred and twenty); extend(300); if(readString == “offauto”) { Autoflag=Zero; damage; } } readString=””; } } } readString=””; }

Google Android: RoboApp.apkRoboApp.apk

Google Android: Step Three: In the slay

Google Android: Section

    Google Android: Solutions

    Read More

    LEAVE A REPLY

    Please enter your comment!
    Please enter your name here