0% found this document useful (0 votes)
69 views1 page

Motorserviceh

This C++ header file defines functions and data types for controlling motors. It includes event and type definitions needed for the motor service. Enumerations are defined for the different motor states like forward and backward. Function prototypes are provided for initializing the motor service, posting events to the service, running the service, driving and rotating motors in different directions, stopping motors, and setting the duty cycle and direction of right and left motors.

Uploaded by

api-397509789
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views1 page

Motorserviceh

This C++ header file defines functions and data types for controlling motors. It includes event and type definitions needed for the motor service. Enumerations are defined for the different motor states like forward and backward. Function prototypes are provided for initializing the motor service, posting events to the service, running the service, driving and rotating motors in different directions, stopping motors, and setting the duty cycle and direction of right and left motors.

Uploaded by

api-397509789
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

#ifndef MotorService_H

#define MotorService_H

// Event Definitions
//#include "ES_Events.h"
#include "ES_Configure.h" /* gets us event definitions */
#include "ES_Types.h" /* gets bool type for returns */

// typedefs for the states


// State definitions for use with the query function
typedef enum { INIT, FORWARD, BACKWARD, STOP, RIGHT, LEFT
} MotorServiceState_t;

// Public Function Prototypes

bool InitMotorService(uint8_t Priority);


bool PostMotorService(ES_Event_t ThisEvent);
ES_Event_t RunMotorService(ES_Event_t ThisEvent);
void DriveForward(uint8_t Duty);
void DriveBackward(uint8_t Duty);
void RotateRight(uint8_t Duty);
void RotateLeft(uint8_t Duty);
void StopMotors(void);
void SetDuty(uint8_t Duty, bool RightMotor);
void SetDirection(bool Forward, bool RightMotor);

#endif

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy