Cubelets API Documentation 2.0
C API
Loading...
Searching...
No Matches
motor.h File Reference

Used for both Rotate and Drive Cubelets.

Go to the source code of this file.

Macros

#define FORWARD   1
 
#define BACKWARD   0
 
#define set_rotate(x)   set_drive(x)
 
#define set_rotate_direction(x)   set_drive_direction(x)
 

Functions

void set_drive (uint8_t bv)
 Set the speed of a drive (or rotate) block.
 
void toggle_directions (void)
 Switch the direction of a drive Cubelet or rotate Cubelet.
 

Macro Definition Documentation

◆ FORWARD

#define FORWARD   1

The default direction for Drive Cubelets and Rotate Cubelets.

◆ BACKWARD

#define BACKWARD   0

The reverse direction for Drive Cubelets and Rotate Cubelets.

◆ set_rotate

#define set_rotate ( x)    set_drive(x)

Alias for set_drive()

◆ set_rotate_direction

#define set_rotate_direction ( x)    set_drive_direction(x)

Alias for set_drive_direction()

Function Documentation

◆ set_drive()

void set_drive ( uint8_t bv)

Set the speed of a drive or rotate block.

Parameters
bvThe value to set the drive to, 0-255. Where 255 is the fastest and 0 is stopped.

◆ toggle_directions()

void toggle_directions ( void )

When called, the drive or rotate Cubelet will switch directions.