ESP Line Following Buggy
2nd Year Embedded System Project (Group 48 - 2023/24)
Loading...
Searching...
No Matches
motor_driver_board.h
Go to the documentation of this file.
1
8#pragma once
9
10#include "mbed.h"
11
12#include "ds2781.h"
13#include "OneWire_Methods.h"
14
27{
28protected:
29
30 DigitalOut board_enable;
32
35
36public:
37
44 MotorDriverBoard(PinName enable_pin, PinName monitor_pin);
45
50 void update_measurements(void);
51
57 void set_enable(bool expression);
58
63 void enable(void);
64
69 void disable(void);
70
76 float get_voltage(void);
77
83 float get_current(void);
84
91 bool get_enable_state(void);
92};
Contains all the functionality of the ESP motor driver board.
int CurrentReading
gets the value of voltage and current as integers per unit value referred to in the ds2781....
float get_voltage(void)
returns the actual voltage value
void update_measurements(void)
updates the measurements of voltage and current values
bool get_enable_state(void)
returns the state of the enable pin
void disable(void)
causes the enable pin to be set to LOW
void set_enable(bool expression)
enable pin will be set to the boolean value in the paremeter
void enable(void)
causes the enable pin to be set to HIGH
MotorDriverBoard(PinName enable_pin, PinName monitor_pin)
Construct a new MotorDriverBoard object.
float get_current(void)
returns the actual curent value
float Current
actual value of the voltage and current
bool enable_state
state of the enable pin
DigitalOut board_enable
pin responsible for enabling the board