mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-05-04 07:10:17 +00:00
82 lines
1.6 KiB
C
82 lines
1.6 KiB
C
/*
|
|
* RobotFunctions.h
|
|
*
|
|
* Created on: Aug 24, 2024
|
|
* Author: DashyFox
|
|
*/
|
|
|
|
#ifndef INC_ROBOTFUNCTIONS_H_
|
|
#define INC_ROBOTFUNCTIONS_H_
|
|
|
|
#include "pca9685.h"
|
|
#include "EEPROM.h"
|
|
|
|
typedef enum ServoMap{
|
|
SERVO_AXIAL = 0,
|
|
SERVO_HORIZONTAL = 1,
|
|
SERVO_VERTICAL = 2
|
|
}ServoMap;
|
|
|
|
typedef enum CurrentMode {
|
|
NoneMode, ShotMode, ProgramMode, MacroMode,
|
|
} Mode;
|
|
|
|
typedef struct CurrentShot {
|
|
uint8_t index;
|
|
Shot shot;
|
|
} CurrentShot;
|
|
|
|
typedef struct CurrentProgram {
|
|
uint8_t index;
|
|
Program program;
|
|
uint8_t shot_index;
|
|
} CurrentProgram;
|
|
|
|
typedef struct CurrentMacro {
|
|
uint8_t index;
|
|
Macro macro;
|
|
uint8_t program_index;
|
|
} CurrentMacro;
|
|
|
|
typedef struct CurrentState {
|
|
uint8_t isPause;
|
|
uint8_t isShooting;
|
|
} CurrentState;
|
|
|
|
typedef struct CurrentInfo {
|
|
Mode mode;
|
|
CurrentState state;
|
|
CurrentShot shot;
|
|
CurrentProgram program;
|
|
CurrentMacro macro;
|
|
} CurrentInfo;
|
|
|
|
void Robot_INIT();
|
|
|
|
void doShot(Shot*);
|
|
void doShotForever(uint8_t number);
|
|
|
|
uint8_t prepareShot(uint8_t number);
|
|
//uint8_t prepareProgramm(uint8_t number);
|
|
//uint8_t prepareMacro(uint8_t number);
|
|
|
|
void startShooting();
|
|
void stopShooting();
|
|
|
|
int16_t map(int16_t x, int16_t in_min, int16_t in_max, int16_t out_min,
|
|
int16_t out_max);
|
|
|
|
void setPos(uint8_t axial, uint8_t horizontal, uint8_t vertical);
|
|
void setPosSingle(ServoMap servo, uint8_t value);
|
|
void setPosDefault();
|
|
void setPosDefaultSingle(ServoMap servo);
|
|
|
|
// 0 .. 100
|
|
void setScrewkSpeed(uint8_t speed);
|
|
|
|
|
|
//(-v) 0 .. 100(stop) .. 200(+v)
|
|
void setRollersSpeed(uint8_t up, uint8_t down); //(-v) 0 . 100(stop) . 200(+v)
|
|
|
|
#endif /* INC_ROBOTFUNCTIONS_H_ */
|