Cubelets API Documentation 2.0
C API
Loading...
Searching...
No Matches
motor.h
Go to the documentation of this file.
1
6#ifndef MOTOR_H
7#define MOTOR_H
8
9#define set_actuator_value(bv) set_drive(bv)
10
14#define FORWARD 1
15
19#define BACKWARD 0
20
28void set_drive(uint8_t bv);
29
33#define set_rotate(x) set_drive(x)
34
35/*
36 * @brief Set the direction of a drive or rotate block.
37 *
38 * Set the direction, FORWARD or BACKWARD, of a drive or rotate block
39 *
40 * @param val The direction to set. Either: FORWARD or BACKWARD
41 */
42void set_drive_direction(uint8_t val);
43
47#define set_rotate_direction(x) set_drive_direction(x)
48
54void toggle_directions(void);
55
56#endif
void toggle_directions(void)
Switch the direction of a drive Cubelet or rotate Cubelet.
Definition motor_api.c:80
void set_drive(uint8_t bv)
Set the speed of a drive (or rotate) block.
Definition motor_api.c:42