eBoard ①⑧⑨
Written for SIA 2017/2018
Servo Struct Reference

[NANO] The standard Arduino Servo Class More...

#include <eagle_Servo.h>

Public Member Functions

 Servo ()
 the constructor More...
 
uint8_t attach (int pin)
 this will tell the Servo-instance which pin the data cable is connected to More...
 
uint8_t attach (int pin, int min, int max)
 this will tell the Servo-instance which pin the data cable is connected to and sets min and maximum values More...
 
void detach ()
 detaches the connected pin More...
 
void write (int value)
 sets angle or pulse width of the Servo More...
 
void writeMicroseconds (int value)
 sets pulse width of the Servo More...
 
int read ()
 reads the current pulse width as angle More...
 
int readMicroseconds ()
 reads the current pulse width More...
 
bool attached ()
 check attached status More...
 

Private Attributes

uint8_t servoIndex
 the channel index this servo is using More...
 
int8_t min
 minimum is this value times 4 added to MIN_PULSE_WIDTH More...
 
int8_t max
 maximum is this value times 4 added to MAX_PULSE_WIDTH More...
 

Detailed Description

[NANO] The standard Arduino Servo Class

Author
Michael Margolis

With EBOARD_NANO this will provide two Servo-instances for you: mainMotor & steerMotor

Definition at line 84 of file eagle_Servo.h.

Constructor & Destructor Documentation

◆ Servo()

Servo::Servo ( )

the constructor

Member Function Documentation

◆ attach() [1/2]

uint8_t Servo::attach ( int  pin)

this will tell the Servo-instance which pin the data cable is connected to

Parameters
pinthe PinID to use
Returns
the channel that will be used - 0 on failure

◆ attach() [2/2]

uint8_t Servo::attach ( int  pin,
int  min,
int  max 
)

this will tell the Servo-instance which pin the data cable is connected to and sets min and maximum values

Parameters
pinthe PinID to use
minthe minimum value
maxthe maximum value
Returns
the channel that will be used - 0 on failure

◆ attached()

bool Servo::attached ( )
inline

check attached status

Returns
attached status

◆ detach()

void Servo::detach ( )

detaches the connected pin

◆ read()

int Servo::read ( )
inline

reads the current pulse width as angle

Returns
returns current angle (software side)

◆ readMicroseconds()

int Servo::readMicroseconds ( )

reads the current pulse width

Returns
returns current pulse width in µs (software side)

◆ write()

void Servo::write ( int  value)

sets angle or pulse width of the Servo

Parameters
valuethe value if <200 it's treated as an angle else it is treated as pulse width in µs

◆ writeMicroseconds()

void Servo::writeMicroseconds ( int  value)

sets pulse width of the Servo

Parameters
valuethe pulse width in µs

Member Data Documentation

◆ max

int8_t Servo::max
private

maximum is this value times 4 added to MAX_PULSE_WIDTH

Definition at line 135 of file eagle_Servo.h.

◆ min

int8_t Servo::min
private

minimum is this value times 4 added to MIN_PULSE_WIDTH

Definition at line 133 of file eagle_Servo.h.

◆ servoIndex

uint8_t Servo::servoIndex
private

the channel index this servo is using

Definition at line 131 of file eagle_Servo.h.


The documentation for this struct was generated from the following file: