![Hits](https://camo.githubusercontent.com/139a0364ca75fa488ec13b67b1466dd815e0afe2b546d81dbad955a66577a157/68747470733a2f2f686974732d6170702e76657263656c2e6170702f686974733f75726c3d68747470733a2f2f6769746875622e636f6d2f61647661792d632f57616c6b696e672d526f626f742d2f6869747326626752696768743d323932423246)
- Install Arduino 1.8.9
- Install the MightyCore arduino library
- Select the board and port (Arduino Nano)
void convert_slow()
{
count_angle = right_hip + 46;
count_angle1 = right_foot + 46;
count_angle2 = left_hip + 46;
count_angle3 = left_foot + 46;
count_angle4 = left_hand + 46;
count_angle5 = right_hand + 46;
_delay_us(3500);
}
void convert()
{
count_angle = right_hip + 46;
count_angle1 = right_foot + 46;
count_angle2 = left_hip + 46;
count_angle3 = left_foot + 46;
count_angle4 = left_hand + 46;
count_angle5 = right_hand + 46;
_delay_us(1200);
}
void home_position()
{
right_hip = 90;
right_foot = 90;
left_hip = 90;
left_foot = 90;
left_hand = 140;
right_hand = 40;
}
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_angle) && (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));
}
if (count <= count_angle4)
{
setbit(PORTD, bitn(3));
}
else if ((count > count_angle4) && (count < 1818))
{
clearbit (PORTD,bitn(3));
}
if (count <= count_angle5)
{
setbit(PORTD, bitn(2));
}
else if ((count > count_angle5) && (count < 1818))
{
clearbit (PORTD,bitn(2));
}
}