Add CustomTimer and separate left/right leg handling
Imported from the unarchived 'hexapod' sketch folder. The real date of this version is unknown; file dates were lost in a 2016-11-14 copy.
This commit is contained in:
1 parent
0447cb8c7a
commit
972ba2cb73
3 files changed
+116
-48
No files matched your search
@@ -12,6 +12,22 @@ Foot foot6 = new Foot();
|
||||
// 10
|
||||
// 10
|
||||
|
||||
// LAYOUT HARDWARE
|
||||
// _U_
|
||||
// 0==/ \==3
|
||||
// >***<
|
||||
// 1===|---|===4
|
||||
// >***<
|
||||
// 2==\___/==5
|
||||
|
||||
// LAYOUT SOFTWARE?
|
||||
// _U_
|
||||
// 1==/ \==6
|
||||
// >***<
|
||||
// 2===|---|===5
|
||||
// >***<
|
||||
// 3==\___/==4
|
||||
|
||||
PVector point1 = new PVector(4.75, 0, 10);
|
||||
PVector point2 = new PVector(7, 0, 0);
|
||||
PVector point3 = new PVector(4.75, 0, -10);
|
||||
@@ -161,26 +177,6 @@ void Vertex(double x, double y, double z)
|
||||
vertex((float)x, (float)y, (float)z);
|
||||
}
|
||||
|
||||
class CustomTimer
|
||||
{
|
||||
int time;
|
||||
boolean start=true;
|
||||
public boolean delay(int delay)
|
||||
{
|
||||
if (start)
|
||||
{
|
||||
time = millis();
|
||||
start = false;
|
||||
}
|
||||
if (millis() - time >= delay)
|
||||
{
|
||||
start = true;
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void DrawFeet()
|
||||
{
|
||||
foot1.Translate(point1);
|
||||
@@ -215,13 +211,22 @@ void RobotWalk()
|
||||
|
||||
animationRepeat = true;
|
||||
animationSpeed = 20;
|
||||
/*
|
||||
foot1.SetFootCoordinates(Animation(walk1, 6, 2)); // BULLSHIT BUG
|
||||
foot1.SetFootCoordinates(Animation(walk1, 6, 2));
|
||||
foot2.SetFootCoordinates(Animation(walk1, 6, 3));
|
||||
foot3.SetFootCoordinates(Animation(walk1, 6, 4));//
|
||||
foot4.SetFootCoordinates(Animation(walk1, 6, 1));//
|
||||
foot5.SetFootCoordinates(Animation(walk1, 6, 0));
|
||||
foot6.SetFootCoordinates(Animation(walk1, 6, 5));
|
||||
foot6.SetFootCoordinates(Animation(walk1, 6, 5));*/
|
||||
foot1.SetFootCoordinates(Animation(walk1, 6, 1)); // BULLSHIT BUG
|
||||
foot1.SetFootCoordinates(Animation(walk1, 6, 1));
|
||||
foot2.SetFootCoordinates(Animation(walk1, 6, 3));
|
||||
foot3.SetFootCoordinates(Animation(walk1, 6, 5));//
|
||||
|
||||
foot4.SetFootCoordinates(Animation(walk1, 6, 0));//
|
||||
foot5.SetFootCoordinates(Animation(walk1, 6, 2));
|
||||
foot6.SetFootCoordinates(Animation(walk1, 6, 4));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user