72 lines
1.0 KiB
C
72 lines
1.0 KiB
C
//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
|
|
{
|
|
//MAIN
|
|
// Pointers to classes
|
|
//hexapod FireFly;
|
|
|
|
//Watchdog
|
|
boolean Send;
|
|
double LastSendTime;
|
|
int WalkTime;
|
|
int HeadTime; //100
|
|
|
|
//Converter
|
|
SerD ServoData[6];
|
|
float HeadAngle;
|
|
int ReadyToSend;
|
|
|
|
//IK
|
|
int HeadPosition;
|
|
boolean ReadyToConvert;
|
|
float l3;
|
|
float s;
|
|
|
|
//Init
|
|
Data()
|
|
{
|
|
LastSendTime = 0;
|
|
HeadAngle = 0;
|
|
HeadTime = 100;
|
|
|
|
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);
|
|
}
|
|
|
|
Data& operator() (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
|
|
|
|
|
|
|