PServo v0.2.1
|
Namespaces | |
namespace | Default |
Classes | |
struct | Props |
class | PServo |
Typedefs | |
typedef struct ps::Props | Props |
Enumerations | |
enum class | State : unsigned char { STANDBY , INITIALIZED , HALT , IN_ACTION , PAUSED , ERROR_UNEXPECTED , ERROR_NOACTION , ERROR_TIMERPTR } |
Functions | |
char const * | state_text (State s) |
Precise servo. Holds the core classes, functions and constants related to the state machine that will control the position (it wont write anything anywere because it doesn't depends on the Arduino.h
library).
When used in .ino
files, it is recommended that the developer consider not using this namespace globally, the names inside this namespace may cause some confusion without the namespace's name as a context. Only inside a function definition it's OK to use using namespace ps;
at the top.
typedef struct ps::Props ps::Props |
List of all the private properties of ps::PServo
. It's primary useful for testing and monitoring strategies, but be aware that you cannot hack those values inside the class, those are read only througth this struct.
Usage example:
|
strong |
This class members has all the possible states for the ps::PServo
state machine. Use it along side with the ps::PServo::get_state()
method to build a more complex logic to your sketch.
Since it's each state is, in fact, a unsigned char
. Maybe you'll need to cast it to a integer type if you want to print the state number on the serial port.
For an example:
Note: The NOOP means that the state will not perform any action nor update any value inside the machine. The responsability to handle and update to a valid state will be at the user's hand.
char const * ps::state_text | ( | ps::State | s | ) |
Return the specified state name in a string. Mainly used for debug and monitoring propurses.
Usage example:
s | Valid state object of an ps::PServo state machine. |