SmartVehicle-Basis
SmartFactory
Hoist Class Reference

Provides the basic functions to control the Hoist. More...

#include <Hoist.h>

Public Member Functions

 Hoist ()
 
 Hoist (int hoistServoPin, int hoistServoDelay, int posMax, int posMin)
 Construct a new Hoist object. More...
 
void init ()
 Initialise the Hoist in the low position. More...
 
bool raise ()
 Raise the Hoist 1° per servodelay/call until it's at positionMax. More...
 
bool lower ()
 Lower the Hoist 1° per servodelay/call until it's at positionMin. More...
 
void attach ()
 attache servo to servopin More...
 
void detach ()
 detach servo from servopin More...
 

Private Attributes

Servo hoistServo
 Instance of servo object. More...
 
int servoPin
 Servopin. More...
 
int position
 actual servo-position More...
 
int positionMin
 minimal possible position (Hardware-Restriction) More...
 
int positionMax
 maximal possible position (Hardware-Restriction) More...
 
int servoDelay
 delay in ms between raise/lower per 1 degree. This sets the servospeed More...
 
unsigned long currentMillis = 0
 will store current time for non blocking delay More...
 
unsigned long previousMillis = 0
 will store last time called for non blocking delay More...
 

Detailed Description

Provides the basic functions to control the Hoist.

Definition at line 28 of file Hoist.h.

Constructor & Destructor Documentation

◆ Hoist() [1/2]

Hoist::Hoist ( )

◆ Hoist() [2/2]

Hoist::Hoist ( int  hoistServoPin,
int  hoistServoDelay,
int  posMax,
int  posMin 
)

Construct a new Hoist object.

Parameters
hoistServoPin- Pin-number on which the Servocontroll is connected
hoistServoDelay- Duration of the Delay in ms between the position-updates
posMax- Upper limit for servo-positon in degree
posMin- Lower limit for servo-position in degree

Definition at line 22 of file Hoist.cpp.

Member Function Documentation

◆ init()

void Hoist::init ( )

Initialise the Hoist in the low position.

Definition at line 34 of file Hoist.cpp.

◆ raise()

bool Hoist::raise ( )

Raise the Hoist 1° per servodelay/call until it's at positionMax.

You need to call attach() first so that the function works properly.

Definition at line 42 of file Hoist.cpp.

◆ lower()

bool Hoist::lower ( )

Lower the Hoist 1° per servodelay/call until it's at positionMin.

You need to call attach() first so that the function works properly.

Definition at line 59 of file Hoist.cpp.

◆ attach()

void Hoist::attach ( )
inline

attache servo to servopin

Definition at line 67 of file Hoist.h.

◆ detach()

void Hoist::detach ( )
inline

detach servo from servopin

Definition at line 76 of file Hoist.h.

Member Data Documentation

◆ hoistServo

Servo Hoist::hoistServo
private

Instance of servo object.

Definition at line 82 of file Hoist.h.

◆ servoPin

int Hoist::servoPin
private

Servopin.

Definition at line 83 of file Hoist.h.

◆ position

int Hoist::position
private

actual servo-position

Definition at line 84 of file Hoist.h.

◆ positionMin

int Hoist::positionMin
private

minimal possible position (Hardware-Restriction)

Definition at line 85 of file Hoist.h.

◆ positionMax

int Hoist::positionMax
private

maximal possible position (Hardware-Restriction)

Definition at line 86 of file Hoist.h.

◆ servoDelay

int Hoist::servoDelay
private

delay in ms between raise/lower per 1 degree. This sets the servospeed

Definition at line 87 of file Hoist.h.

◆ currentMillis

unsigned long Hoist::currentMillis = 0
private

will store current time for non blocking delay

Definition at line 89 of file Hoist.h.

◆ previousMillis

unsigned long Hoist::previousMillis = 0
private

will store last time called for non blocking delay

Definition at line 90 of file Hoist.h.


The documentation for this class was generated from the following files: