uStepper S-lite
uStepperServo.h
Go to the documentation of this file.
1 /********************************************************************************************
2 * File: uStepperServo.h *
3 * Version: 1.1.0 *
4 * Date: June 14, 2020 *
5 * Author: Thomas Hørring Olsen *
6 * *
7 *********************************************************************************************
8 * (C) 2020 *
9 * *
10 * uStepper ApS *
11 * www.ustepper.com *
12 * administration@ustepper.com *
13 * *
14 * The code contained in this file is released under the following open source license: *
15 * *
16 * Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International *
17 * *
18 * The code in this file is provided without warranty of any kind - use at own risk! *
19 * neither uStepper ApS nor the author, can be held responsible for any damage *
20 * caused by the use of the code contained in this file ! *
21 * *
22 ********************************************************************************************/
33 #ifndef _USTEPPERSERVO_H
34 #define _USTEPPERSERVO_H
35 
36 #include <Arduino.h>
37 #include <inttypes.h>
38 
39 #define NO_ANGLE (0xff)
40 
45 {
46  private:
48  uint8_t pin;
50  uint8_t angle;
52  uint16_t pulse;
54  uint8_t min16;
56  uint8_t max16;
57 
61 
63  static uStepperServo* first;
64  public:
65 
73  uStepperServo();
74 
86  uint8_t attach(int pinArg);
87 
93  void detach();
94 
102  void write(int angleArg);
103 
112  void setMinimumPulse(uint16_t t);
113 
122  void setMaximumPulse(uint16_t t);
123 
131  static void refresh();
132 };
133 
134 #endif
uStepperServo::refresh
static void refresh()
Updates servo output pins.
Definition: uStepperServo.cpp:153
uStepperServo::attach
uint8_t attach(int pinArg)
Attaches the servo motor to a specific pin.
Definition: uStepperServo.cpp:119
uStepperServo::detach
void detach()
Detaches the servo motor from the uStepper.
Definition: uStepperServo.cpp:131
uStepperServo::write
void write(int angleArg)
Specify angle of servo motor.
Definition: uStepperServo.cpp:142
uStepperServo::setMaximumPulse
void setMaximumPulse(uint16_t t)
Sets the maximum pulse.
Definition: uStepperServo.cpp:114
uStepperServo::setMinimumPulse
void setMinimumPulse(uint16_t t)
Sets the minimum pulse.
Definition: uStepperServo.cpp:109
uStepperServo::next
class uStepperServo * next
Definition: uStepperServo.h:60
uStepperServo::first
static uStepperServo * first
Definition: uStepperServo.h:63
uStepperServo
Prototype of class for ustepper servo.
Definition: uStepperServo.h:45
uStepperServo::uStepperServo
uStepperServo()
Constructor for servo class.
Definition: uStepperServo.cpp:104
uStepperServo::min16
uint8_t min16
Definition: uStepperServo.h:54
uStepperServo::pin
uint8_t pin
Definition: uStepperServo.h:48
uStepperServo::max16
uint8_t max16
Definition: uStepperServo.h:56
uStepperServo::angle
uint8_t angle
Definition: uStepperServo.h:50
uStepperServo::pulse
uint16_t pulse
Definition: uStepperServo.h:52