ESP Line Following Buggy
2nd Year Embedded System Project (Group 48 - 2023/24)
|
Contains all the functionality of the ESP motor driver board. More...
#include <motor_driver_board.h>
Public Member Functions | |
MotorDriverBoard (PinName enable_pin, PinName monitor_pin) | |
Construct a new MotorDriverBoard object. | |
void | update_measurements (void) |
updates the measurements of voltage and current values | |
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 | |
void | disable (void) |
causes the enable pin to be set to LOW | |
float | get_voltage (void) |
returns the actual voltage value | |
float | get_current (void) |
returns the actual curent value | |
bool | get_enable_state (void) |
returns the state of the enable pin | |
Protected Attributes | |
DigitalOut | board_enable |
pin responsible for enabling the board | |
bool | enable_state |
state of the enable pin | |
int | VoltageReading |
int | CurrentReading |
gets the value of voltage and current as integers per unit value referred to in the ds2781.cpp in more detail | |
float | Voltage |
float | Current |
actual value of the voltage and current | |
Contains all the functionality of the ESP motor driver board.
Functionality:
Uses this Library by Sam Walsh to interface with the current/voltage IC. https://os.mbed.com/users/EmbeddedSam/code/Nucleo_F401RE_DS271_Battery_Monitor/
Definition at line 26 of file motor_driver_board.h.
MotorDriverBoard::MotorDriverBoard | ( | PinName | enable_pin, |
PinName | monitor_pin ) |
Construct a new MotorDriverBoard object.
enable_pin | motor driver board enable (EN) pin |
monitor_pin | motor driver board monitor (OneWire) pin |
Definition at line 13 of file motor_driver_board.cpp.
void MotorDriverBoard::disable | ( | void | ) |
causes the enable pin to be set to LOW
Definition at line 26 of file motor_driver_board.cpp.
void MotorDriverBoard::enable | ( | void | ) |
causes the enable pin to be set to HIGH
Definition at line 19 of file motor_driver_board.cpp.
float MotorDriverBoard::get_current | ( | void | ) |
returns the actual curent value
Definition at line 52 of file motor_driver_board.cpp.
bool MotorDriverBoard::get_enable_state | ( | void | ) |
returns the state of the enable pin
Definition at line 58 of file motor_driver_board.cpp.
float MotorDriverBoard::get_voltage | ( | void | ) |
returns the actual voltage value
Definition at line 47 of file motor_driver_board.cpp.
void MotorDriverBoard::set_enable | ( | bool | expression | ) |
enable pin will be set to the boolean value in the paremeter
expression | boolean value or operation to be applied |
Definition at line 41 of file motor_driver_board.cpp.
void MotorDriverBoard::update_measurements | ( | void | ) |
updates the measurements of voltage and current values
Definition at line 33 of file motor_driver_board.cpp.
|
protected |
pin responsible for enabling the board
Definition at line 30 of file motor_driver_board.h.
|
protected |
actual value of the voltage and current
Definition at line 34 of file motor_driver_board.h.
|
protected |
gets the value of voltage and current as integers per unit value referred to in the ds2781.cpp in more detail
Definition at line 33 of file motor_driver_board.h.
|
protected |
state of the enable pin
Definition at line 31 of file motor_driver_board.h.
|
protected |
Definition at line 34 of file motor_driver_board.h.
|
protected |
Definition at line 33 of file motor_driver_board.h.