Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: HIDScope mbed MODSERIAL QEI
Motor.h
- Committer:
- john111222333
- Date:
- 2017-11-02
- Revision:
- 16:a2a73d57d556
- Parent:
- 14:f561498eee28
File content as of revision 16:a2a73d57d556:
#ifndef MOTOR_H
#define MOTOR_H
#include "mbed.h"
#include "QEI.h"
#include "iostream"
#include "cmath"
class Motor {
private:
float angle ; // angle of the motor in degrees
float frequency ;
float safety_angle; //safety angle in degrees
float low_PWM;
QEI _Encoder;
DigitalOut _direction;
PwmOut _PWM;
int POS;
int initial_angle;
float Kp , Ki , Kd ;
void set_period(float);
double Control_PID(float);
public:
Motor();
Motor(PinName , PinName , PinName , PinName , float , float , float , int , int , float , float , float);
float Control_angle(float);
float set_angle(); //needs to be updated
float get_angle();
};
#endif
