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.
ESCON_motor.h
00001 /** 00002 * @author Jinhyuk Yoon 00003 * 00004 * Designed to control ESCON via NUCELO-F767ZI 00005 00006 **/ 00007 00008 00009 #include "mbed.h" 00010 #define PI 3.14159265358979323846 00011 00012 class ESCON_motor { 00013 private: 00014 DigitalOut enable_; 00015 DigitalOut dir_; 00016 PwmOut pwm_; 00017 double period; 00018 double duty_cycle; 00019 00020 00021 public: 00022 /* 00023 * @param _enable_out_pin digital out pin name which controls enable. 00024 * @param _dir_out_pin digital out pin name which controls diretion. 00025 * @param _pwm_out_pin pwm out pin name whcih controls pwm signal. 00026 * @param duty_cycle value between 0.0 and 1.0. (0.5 means 50% duty cycle.) 00027 * @param motor_time_const can be found in motor spec. Unit is millesecond(ms) 00028 */ 00029 ESCON_motor(PinName _enable_out_pin, PinName _dir_out_pin, PinName _pwm_out_pin, double _duty_cycle, double motor_time_const); 00030 void enable(void); 00031 void disable(void); 00032 void CW(void); 00033 void CCW(void); 00034 void pwm(void); 00035 void pwmDutyCycleChange(double _duty_cycle); 00036 };
Generated on Mon Aug 22 2022 05:43:00 by
1.7.2