FireFly 2012: the robot code as an Arduino library 'hexapod' (v3.1): IK, SSC-32, IR, ultrasonic, GPS, 7-segment
From Electronics\Hexapod\Arduino library 2012.
This commit is contained in:
1 parent
f0b272a1d3
commit
304367a769
21 files changed
+3043
No files matched your search
@@ -0,0 +1,58 @@
|
||||
//Data.h Data Structure
|
||||
|
||||
#ifndef DATA
|
||||
#define DATA
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "Def.h"
|
||||
#include "SerD.h"
|
||||
|
||||
// LAYOUT
|
||||
// _U_
|
||||
// 0==/ \==3
|
||||
// >***<
|
||||
// 1===|---|===4
|
||||
// >***<
|
||||
// 2==\___/==5
|
||||
|
||||
struct Data
|
||||
{
|
||||
int HeadTime;
|
||||
int WalkTime;
|
||||
SerD ServoData[6];
|
||||
float HeadAngle;
|
||||
|
||||
//IK
|
||||
int HeadPosition;
|
||||
float l3;
|
||||
float s;
|
||||
|
||||
//Init
|
||||
Data()
|
||||
{
|
||||
HeadAngle = 0;
|
||||
|
||||
ServoData[0](5, 3, 8);
|
||||
ServoData[1](8, 3, 0);
|
||||
ServoData[2](5, 3, -8);
|
||||
ServoData[3](5, 3, 8);
|
||||
ServoData[4](8, 3, 0);
|
||||
ServoData[5](5, 3, -8);
|
||||
}
|
||||
|
||||
void input (DataObject* R)
|
||||
{
|
||||
ServoData[0] = R->S0;
|
||||
ServoData[1] = R->S1;
|
||||
ServoData[2] = R->S2;
|
||||
ServoData[3] = R->S3;
|
||||
ServoData[4] = R->S4;
|
||||
ServoData[5] = R->S5;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user