Swag Module

Description

Contains the functions for initializing and actuating the SWAG motor.

SwagInit()

Takes 2 variables of type OutputT and returns nothing. When main calls this function, it tells the swag module which ports to be used for the swag motor.

DropSwag()

Takes no variable and drops swags.

Opendoor()

Opens the Swag Door

Closedoor()

Closes the Swag Door

Implementation

Module static variables

static OutputT   SwagOpen,SwagClose

SwagInit()

Pass the arguments of SwagInit function (two OutputT) into the module static variable SwagOpen and SwagClose
Closedoor

DropSwag()

Opendoor

Wait 2ms.

Closedoor

Opendoor()

Write 0 to SwagClose output

Write 1 to SwagOpen output

Wait 100ms

Write 0 to SwagOpen output

Closedoor()

Write 0 to SwagOpen output

Write 1 to SwagClose output

Wait 100ms

Write 0 to SwagClose output