DFRduino Arduino Library  0.0.1
Provides an object used to control a DFRduino based robot
 All Classes Files Functions
DFRduino.h
Go to the documentation of this file.
1 
17 #ifndef DFRduino_h
18 #define DFRduino_h
19 
20 #include "Arduino.h"
21 #include <Servo.h>
22 
23 #define LEFT_MOTOR_SPEED_CONTROL 5
24 #define RIGHT_MOTOR_SPEED_CONTROL 6
25 #define LEFT_MOTOR_DIRECTION_CONTROL 4
26 #define RIGHT_MOTOR_DIRECTION_CONTROL 7
27 
28 #define DISTANCE_SENSOR_INPUT_PIN A5
29 
30 #define HORIZONTAL_SERVO_PIN 13
31 #define VERTICAL_SERVO_PIN 12
32 class DFRduino {
33 public:
37  DFRduino();
38 
47  void setDirection(char direction);
48 
54  void setMotors(int left, int right);
55 
64  void setHorizontalHeadPosition(int angle);
65 
75  void setVerticalHeadPosition(int angle);
76 
82 
83 private:
86  void initMotors();
87 
91  void initSensors();
92 
96  void error(char *error_message);
97 
101  int scaleSpeedToRangeOfInt(int speed);
102  Servo horizontalServo;
103  Servo verticalServo;
104 };
105 
106 #endif
Definition: DFRduino.h:32
void setHorizontalHeadPosition(int angle)
Definition: DFRduino.cpp:90
void setMotors(int left, int right)
Definition: DFRduino.cpp:52
void setVerticalHeadPosition(int angle)
Definition: DFRduino.cpp:96
void setDirection(char direction)
Definition: DFRduino.cpp:31
int readDistanceInCentimeters()
Definition: DFRduino.cpp:73
DFRduino()
Definition: DFRduino.cpp:15