Deze moet je hebben Menner Dennis

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers motorDriver.h Source File

motorDriver.h

00001 #include "mbed.h"
00002 #include <ros.h>
00003 #include <std_msgs/Float64.h>
00004 #include <string>
00005 #include "rtos.h"
00006 
00007 
00008 class motorDriver{
00009 
00010 public:
00011     motorDriver(PinName Left1, PinName Left2, PinName Right1, PinName Right2, PinName PWML, PinName PWMR/*, PinName spdReadL, PinName spdReadR, PinName Bat*/);
00012     
00013     //Direction functions: Subscribe and Set
00014 //    void subDirection();
00015     void setDirection(bool  keyForward,  bool  keyBackward, bool  keyLeft, bool  keyRight);  // fwd bck, lft,rght
00016 
00017     
00018     // Get and publish speed information to the Raspberry Pi
00019 //    void getSpeedL(); 
00020 //    void getSpeedR();
00021 
00022 //     void getBattery();
00023     
00024     //get and publish current information to the Raspberry Pi
00025 //   void getCurrent();
00026 //   void pubCurrent();
00027    
00028 
00029     
00030 protected:
00031     
00032     DigitalOut speedLeft1;
00033     DigitalOut speedLeft2;        
00034     DigitalOut speedRight1;
00035     DigitalOut speedRight2; 
00036    
00037     PwmOut pwmL;
00038     PwmOut pwmR;
00039     
00040     //DigitalIn speedReadL;
00041     //DigitalIn speedReadR;
00042     
00043     //AnalogIn BatteryRead; 
00044           
00045     bool  keyForward;           
00046     bool  keyBackward;
00047     bool  keyLeft;
00048     bool  keyRight;
00049     
00050     
00051     //ros::NodeHandle nh;
00052     //std_msgs::Float64 value_msg;
00053     //float currentLeft; 
00054     //float currentRight;
00055 
00056     };