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.
Fork of IEEE_14_Freescale by
remoteMotor.h
00001 /* 00002 * File: remoteMotor.h 00003 * Author: Shawn Swatek 00004 * Originated: Spring 2013 00005 * Revised: 3/30/13 00006 */ 00007 00008 #ifndef __REMOTEMOTOR__ 00009 #define __REMOTEMOTOR__ 00010 00011 #include "mbed.h" 00012 #include "remoteEnc.h" 00013 00014 //each motor is driven by three control wires, one for the high side of the motor, one for the low side, and a pwm (digital approximation of analog) for speed 00015 // the two non-pwm signals come from the remote processor and are controlled by this class 00016 00017 class remoteMotor { 00018 private: 00019 remoteEnc &remote; 00020 int remoteA; 00021 int remoteB; 00022 PwmOut OutPWM; 00023 int reversed; 00024 public: 00025 remoteMotor(remoteEnc &remoteIn, int APin,int BPin, PinName PWMPin); 00026 int setPower(double power); 00027 int setReversed(int state); 00028 int brake(); 00029 }; 00030 00031 // this is for a different style of motor driver that only uses one wire for forward/reverse, and another for pwm-ing enable 00032 class simpleRemoteMotor { 00033 private: 00034 remoteEnc &remote; 00035 int remotepin; 00036 PwmOut OutPWM; 00037 int reversed; 00038 double currPower; 00039 public: 00040 simpleRemoteMotor(remoteEnc &remotedev, int remotepinin, PinName PWMPin); 00041 int setPower(double power); 00042 int setReversed(int state); 00043 double getPower() {return currPower;} 00044 }; 00045 00046 #endif
Generated on Wed Jul 13 2022 07:38:25 by
