Skip to content

shifter.h

Lukáš Dršman edited this page May 14, 2022 · 1 revision

Contains functions for shifting.

shifter type

The struct type for shifter is defined as

typedef struct Shifter
{
    motor smotor, dmotor;
}
shifter;

consisting of a shifter motor (smotor) and a driver motor (dmotor).

Constructor

The constructor for shifter is defined as

shifter shifterNew(char sport, char dport);

where sport is the port to which the shifter motor is connected and where dport is the port to which the driver motor is connected.

If a setup, where the shifter motor is connected to port B and the driver motor to port C, is used, then the corresponding shifter would be constructed using

shifter foo;
foo = shifterNew('B', 'C');

Functions

void shifterShift(shifter s, int id);
  • shifts to a module at angle id * SHIFTER_OFFSET
  • for a shifter with an offset of 90°, the possible values for id are 0, 1, 2 and 3
  • Parameters:
    • shifter s - shifter object
    • int id - module locator
Clone this wiki locally