with the tof code
Dependencies: mbed Servo ros_lib_kinetic
Diff: Motors/Motor.h
- Revision:
- 9:326b8f261ef0
- Parent:
- 8:262c6c40bff9
--- a/Motors/Motor.h Tue Dec 10 11:52:53 2019 +0000 +++ b/Motors/Motor.h Sat Jan 04 21:35:25 2020 +0000 @@ -8,6 +8,7 @@ #include "mbed.h" #include "Buzzer.h" #include <ros.h> +#include <Servo.h> #include <std_msgs/UInt8.h> /*-------------------------------------------------------------------------------- @@ -27,6 +28,12 @@ #define M2_PWM PB_4 #define M2_A PB_5 #define M2_B PB_3 +#define srvoPan PE_5 +#define srvoTilt PF_9 + + +static Servo servo1(srvoTilt); +static Servo servo2(srvoPan); /*-------------------------------------------------------------------------------- ---------------------------------CLASSES------------------------------------------ @@ -53,11 +60,17 @@ --------------------------------------------------------------------------------*/ void Check_for_obstacles(uint8_t TOFRange[4]); //Obstacle avoidance functionality void update_power_levels(float vBatt); //Sends power level to the LED class for further processing -void keySub(const std_msgs::UInt8 &keyPress); +void MotorKeySub(const std_msgs::UInt8 &keyPress); +void servoKeySub(const std_msgs::UInt8 &ServoKeyPress); + /*-------------------------------------------------------------------------------- --------------------------------External Variables-------------------------------- --------------------------------------------------------------------------------*/ //extern cMotor MotorL; //Left motor class and pin initialisation //extern cMotor MotorR; //Right motor class and pin initialisation + +static int IncSize; //Increment size for servo movment in increments of 1 - 20 degrees + + #endif \ No newline at end of file