FireFly 2012: behaviour rewrite now uses the hexapod library

From Electronics\Hexapod\Arduino sketches 2011-2012\FireFly. Data.h, Def.h and SerD.h moved into the library.
This commit is contained in:
mangavalk committed 2012-07-23 17:56:33 +02:00
1 parent 304367a769
commit 6e50819e01
9 files changed
+84 -465

No files matched your search

@@ -1,88 +1,55 @@
//Gedrags classen,
#ifndef GCC
#define GCC
#include "SerD.h"
// LAYOUT
// _U_
// 0==/ \==3
// >***<
// 1===|---|===4
// >***<
// 2==\___/==5
class DataObject
{
public:
SerD S0;
SerD S1;
SerD S2;
SerD S3;
SerD S4;
SerD S5;
DataObject& operator() (SerD s0, SerD s1, SerD s2, SerD s3, SerD s4, SerD s5)
{
S0 = s0;
S1 = s1;
S2 = s2;
S3 = s3;
S4 = s4;
S5 = s5;
}
DataObject& operator() ( int a1, int a2, int a3,
int b1, int b2, int b3,
int c1, int c2, int c3,
int d1, int d2, int d3,
int e1, int e2, int e3,
int f1, int f2, int f3)
{
S0(a1, a2, a3);
S1(b1, b2, b3);
S2(c1, c2, c3);
S3(d1, d2, d3);
S4(e1, e2, e3);
S5(f1, f2, f3);
}
};
class WalkForward //Direction
{
private:
DataObject LoopPatroon[8];
DataObject HuidigePositie;
//Startup VARIABLES
void init()
{
/*LoopPatroon.S0[0][0](, , );
LoopPatroon.S1[0][1](, , );
LoopPatroon.S3[0][2](, , );
LoopPatroon.S4[0][3](, , );
LoopPatroon.S5[0][4](, , );
LoopPatroon.S6[0][5](, , );*/
LoopPatroon[0](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
public:
void Run()
{
//Start runnning code until exit or expection raises.
}
};
#endif
//Gedrags classen,
#ifndef GCC
#define GCC
#include "hexapod.h"
// LAYOUT
// _U_
// 0==/ \==3
// >***<
// 1===|---|===4
// >***<
// 2==\___/==5
class WalkForward //Direction
{
private:
DataObject LoopPatroon[8];
DataObject HuidigePositie;
hexapod *FireFly;
//Startup VARIABLES
void init(hexapod *pntr)
{
LoopPatroon[0](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 800);
LoopPatroon[1](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 800);
LoopPatroon[2](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 800);
LoopPatroon[3](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 800);
LoopPatroon[4](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 800);
LoopPatroon[5](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 800);
LoopPatroon[6](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 800);
LoopPatroon[7](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 800);
FireFly = pntr;
}
void send(DataObject pntr)
{
FireFly->CoreSend(&pntr);
}
public:
void Run()
{
//Start runnning code until exit or expection raises.
send(LoopPatroon[0]);//Test
}
};
#endif