Welcome to the EyeBot  Version 7 - RPi1
A Controller For Various Hardware IO
servos_and_motors.h
Go to the documentation of this file.
1 
7 #ifndef SERVOS_AND_MOTORS_H_
8 #define SERVOS_AND_MOTORS_H_
9 
10 #include "serial.h"
11 #include "hdt.h"
12 #include "types.h"
13 
14 #define SERVO_LOW 0
15 #define SERVO_HIGH 255
16 
17 int ENCODERBaseVal[4];
18 HDT_MOTOR *MOTORFirst;
19 HDT_SERVO *SERVOFirst;
20 int MOTORInitialised;
21 int SERVOInitialised;
22 
23 int MOTORInit();
24 int SERVOInit();
25 
26 int SERVORange(int servo, int low, int high);
27 int SERVOSet(int servo, int angle);
28 int SERVOSetRaw(int servo, int angle);
29 int MOTORDrive(int motor, int speed);
30 int MOTORDriveRaw(int motor, int speed);
31 
32 int MOTORPID(int motor, int p, int i, int d); // Set motor [1..4] PID controller values [1..255]
33 int MOTORPIDoff(int motor); // Stop PID control loop
34 int MOTORSpeed(int motor, int ticks); // Set controlled motor speed in ticks/100 sec
35 
36 int ENCODERRead(int quad); // Read quadrature encoder [1..4]
37 int ENCODERReset(int quad); // Set encoder value to 0 [1..4]
38 
39 #endif /* SERVOS_AND_MOTORS_H_ */
int ENCODERRead(int quad)
Reads the value from the encoder.
Definition: servos_and_motors.c:354
Defines types used for the EyeBot 7.
int MOTORDriveRaw(int motor, int speed)
Set the given motor to a given speed.
Definition: servos_and_motors.c:178
Structure defining a HDT Motor.
Definition: types.h:331
int SERVOInit()
Initialises the IO board and sets up tables for servos.
Definition: servos_and_motors.c:15
int MOTORPIDoff(int motor)
Shuts off PID control.
Definition: servos_and_motors.c:293
int MOTORSpeed(int motor, int ticks)
Sets the controlled motor speed in ticks/sec.
Definition: servos_and_motors.c:324
int MOTORPID(int motor, int p, int i, int d)
Set the given motors with PID control.
Definition: servos_and_motors.c:261
Defines all the functions to connect to a serial USB/serial connection.
int MOTORDrive(int motor, int speed)
Set the given motors to the same given speed dependant on hdt table.
Definition: servos_and_motors.c:212
int ENCODERReset(int quad)
Resets the encoder, in reality just stores the current value of the encoder and subtracts it from fut...
Definition: servos_and_motors.c:398
Structure defining a HDT servo.
Definition: types.h:358
int SERVOSetRaw(int servo, int angle)
Set the given servos to the same given angle in raw mode.
Definition: servos_and_motors.c:144
int MOTORInit()
Initialises the IO board and sets up tables for motors.
Definition: servos_and_motors.c:42
Header file for the HDT functions.
int SERVORange(int servo, int low, int high)
Sets the range for the servos.
Definition: servos_and_motors.c:75
int SERVOSet(int servo, int angle)
Set the given servos to the same given angle depending on table value.
Definition: servos_and_motors.c:97