initial commit

This commit is contained in:
chi
2025-01-07 16:07:58 +09:00
commit 9e657e2558
18 changed files with 2723 additions and 0 deletions

52
Arduino_PLC/motor.h Normal file
View File

@@ -0,0 +1,52 @@
#ifndef _MOTOR_H_
#define _MOTOR_H_
#include "arduino.h"
#include "VarClass.h"
enum ZRunMode
{
ZRUN_STOP = 0,
ZRUN_UP,
ZRUN_DN
};
enum ZDirection
{
ZDIR_CW = 0,
ZDIR_CCW
};
class motor {
public:
void Setup();
void Update();
void SetSpeedZ(uint8_t value);
ZDirection GetZDirL(); //Z축 진행방향을 표시합니다. True 일경우, 정방향(위로), False일경우 역방향(아래로)
ZDirection GetZDirR(); //Z축 진행방향을 표시합니다. True 일경우, 정방향(위로), False일경우 역방향(아래로)
void SetZDir(ZDirection direction); //1=정방향, 0=역방향
void SetZRun(ZRunMode run);
void SetZRunL(bool run);
void SetZRunR(bool run);
bool IsMoveZ(); //현재 이동중인가?
private:
void SetPowerL(bool on);
void SetPowerR(bool on);
bool IsMoveZL();
bool IsMoveZR();
void ZLimit_AutoStop(); //Z축 리밋센서에 의한 동작 정지
};
extern motor mot;
#endif