ME 507 Romi++
Cylindrical Differential Drive Robot created for ME 507 at Cal Poly in Spring 2025
Loading...
Searching...
No Matches
bluetooth.h
Go to the documentation of this file.
1/*
2 * bluetooth.h
3 *
4 * Created on: Jun 3, 2025
5 * Author: jacka
6 */
7
8#ifndef INC_BLUETOOTH_H_
9#define INC_BLUETOOTH_H_
10
18
19#include <stdint.h>
20
22extern int32_t V;
23
31{
32public:
46
50 BLUETOOTH();
51
56 void run(void);
57
62 void set_command(char cmd); // Called from interrupt handler
63
68 int16_t get_M1_set(void);
69
74 int16_t get_M2_set(void);
75
76private:
77 state_t state;
78 char command;
79 int16_t M1_set;
80 int16_t M2_set;
81};
82
83#endif /* INC_BLUETOOTH_H_ */
int32_t V
Velocity setpoint (in encoder counts/sec) received via Bluetooth.
Definition main.cpp:112
void set_command(char cmd)
Sets the most recent command character received over Bluetooth.
Definition bluetooth.cpp:24
int16_t get_M1_set(void)
Retrieves the motor 1 setpoint based on last command.
Definition bluetooth.cpp:30
BLUETOOTH()
Constructor for the BLUETOOTH class.
Definition bluetooth.cpp:14
void run(void)
Executes one iteration of the Bluetooth FSM.
Definition bluetooth.cpp:42
int16_t get_M2_set(void)
Retrieves the motor 2 setpoint based on last command.
Definition bluetooth.cpp:36
state
Definition bluetooth.h:38
@ S1_STOP
Stop motors.
Definition bluetooth.h:40
@ S0_INIT
Initialization state.
Definition bluetooth.h:39
@ SL_LEFT
Turn left.
Definition bluetooth.h:44
@ SB_BACKWARD
Move backward.
Definition bluetooth.h:42
@ SF_FORWARD
Move forward.
Definition bluetooth.h:41
@ SR_RIGHT
Turn right.
Definition bluetooth.h:43