Skip to content

module.h

Lukáš Dršman edited this page May 14, 2022 · 2 revisions

Contains functions for module driving. Depends on shifter.

Functions

void moduleAsyncDrive(shifter s, int target, int id);
  • drives module at id asynchronously to target angle
  • Parameters:
    • shifter s - shifter object
    • int target - target angle at the driver motor
    • int id - module locator (possible values for 90° offset: 0, 1, 2, 3)
void moduleAwaitDrive(shifter s);
  • pauses thread from executing following calls until module finishes its action
  • Parameters:
    • shifter s - shifter object

Macros

#define moduleDrive(s, target, id) \
    ({ moduleAsyncDrive(s, target, id); \
       moduleAwaitDrive(s); })
  • drives module at id synchronously to target angle
  • Parameters:
    • shifter s - shifter object
    • int target - target angle at the driver motor
    • int id - module locator (possible values for 90° offset: 0, 1, 2, 3)
Clone this wiki locally