From 31c905ad1d02ec2ace13d00ea5f8b3a209160c67 Mon Sep 17 00:00:00 2001 From: Gab_S Date: Wed, 20 Nov 2019 23:15:19 +0000 Subject: [PATCH] Delete 'Motorz.h' --- Motorz.h | 91 -------------------------------------------------------- 1 file changed, 91 deletions(-) delete mode 100644 Motorz.h diff --git a/Motorz.h b/Motorz.h deleted file mode 100644 index 085c7de..0000000 --- a/Motorz.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef _MOTORZ_H // not #ifnotdef -#define _MOTORZ_H - -class Motorz -{ - private: - int motor_speed=0; - int enable,in1,in2,dir; - public: - - Motorz(int Enb,int ina,int inb){ - enable=Enb; - in1=ina; - in2=inb; - pinMode(enable,OUTPUT); - pinMode(in1,OUTPUT); - pinMode(in2,OUTPUT); - } - Motorz(int Enb,int ina,int inb,int d){ - enable=Enb; - in1=ina; - in2=inb; - dir=d; - pinMode(enable,OUTPUT); - pinMode(in1,OUTPUT); - pinMode(in2,OUTPUT); - Direction(); - } - void SetSpeed(int Mspeed){ - motor_speed=Mspeed; - } - int GetSpeed(){ - return motor_speed; - } - void SetEnable(int pin){ - enable=pin; - } - int GetEnable(){ - return enable; - } - void SetInput1(int pin){ - in1=pin; - } - int GetInput1(){ - return in1; - } - void SetInput2(int pin){ - in2=pin; - } - int GetInput2(){ - return in2; - } - void SetDirection(int a){ - dir=a; - } - int GetDirection(){ - return dir; - } - void ChangeDir(){ - if(dir==0){ - dir=1; - } - else{ - dir=0; - } - } - void Start(){ - this->Direction(); - analogWrite(enable,motor_speed); - } - void Stop(){ - this->Halt(); - } - private: - void Direction(){ - if(dir==0){ - digitalWrite(in1,HIGH); - digitalWrite(in2,LOW); - } - else{ - digitalWrite(in1,LOW); - digitalWrite(in2,HIGH); - } - } - void Halt(){ - digitalWrite(in1,LOW); - digitalWrite(in2,LOW); - } - -}; -#endif _MOTOR_H