Skip to content

walking robot dog using arduino nano + 4 servo motors

License

Notifications You must be signed in to change notification settings

advayc/Quadruped

Repository files navigation

Quadruped

Walking quadruped robot using arduino nano + 4 servo motors

Installation

  1. Install Arduino IDE 2.2.1
  2. Install the MightyCore arduino library
  3. Open the .ino file into the Arduino IDE
  4. Select the board and port (Arduino Nano)

Functions

Convert

void convert()
{
count_angle = right_fore + 46;
count_angle1 = right_hind + 46;
count_angle2 = left_fore + 46;
count_angle3 = left_hind + 46;
_delay_us(1200);
}

Home Position

void home_position()
{
right_fore = 90;
right_hind = 90;
left_fore = 90;
left_hind = 90;
} 

Timer

ISR (TIMER1_COMPA_vect)
{
count++;
if (count <= count_angle)
{
  setbit(PORTD, bitn(4));
}
else if ((count > count_angle) && (count < 1818))
{
  clearbit(PORTD, bitn(4));
}
else if (count >= 1818)
{
  count = 0;
}
if (count <= count_angle1)
{
  setbit(PORTD, bitn(5));
}
else if (( count > count_angle1) && (count < 1818))
{
  clearbit(PORTD, bitn(5));
}
if (count <= count_angle2)
{
  setbit(PORTD, bitn(6));
}
else if ((count > count_angle2) && (count < 1818))
{
  clearbit(PORTD, bitn(6));
}
if ( count <= count_angle3)
{
  setbit(PORTD, bitn(7));
}
else if ((count > count_angle3) && (count < 1818))
{
  clearbit(PORTD, bitn(7));
}
}

About

walking robot dog using arduino nano + 4 servo motors

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages