SarpUsta
Published © MIT

Walking Plane

A walking plane.

BeginnerShowcase (no instructions)733
Walking Plane

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Arduino Sensor Shield
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×2

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

projedosya

Code

CodeWalkingplane

Arduino
/*

*/
#include <Servo.h>
int pos1 = 0;
int pos2 = 90;
Servo servo1;
Servo servo2;
void setup() {
  servo1.attach(9);
  servo2.attach(8)
}

void loop() {
  for (pos1 = 0; pos1 <= 90; pos1 += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    servo1.write(pos1);              // tell servo to go to position in variable 'pos'
    delay(10);                       // waits 15ms for the servo to reach the position
  }
  for (pos2 = 90; pos2 >= 0; pos2 -= 1) { // goes from 180 degrees to 0 degrees
    servo2.write(pos2);              // tell servo to go to position in variable 'pos'
    delay(10); 
  }
  for (pos1 = 0; pos1 <= 90; pos1 += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    servo1.write(pos1);              // tell servo to go to position in variable 'pos'
    delay(10);                       // waits 15ms for the servo to reach the position
  }
  for (pos2 = 90; pos2 >= 0; pos2 -= 1) { // goes from 180 degrees to 0 degrees
    servo2.write(pos2);              // tell servo to go to position in variable 'pos'
    delay(10); 
  }
}

Credits

SarpUsta
4 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.