uStepper S
uStepperServo.h
Go to the documentation of this file.
1 /********************************************************************************************
2 * File: uStepperServo.h *
3 * Version: 2.0.0 *
4 * Date: March 30th, 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 
42 class uStepperServo
43 {
44  private:
46  uint8_t pin;
48  uint8_t angle;
50  uint16_t pulse;
52  uint8_t min16;
54  uint8_t max16;
55 
58  class uStepperServo *next;
59 
61  static uStepperServo* first;
62  public:
63 
71  uStepperServo();
72 
84  uint8_t attach(int pinArg);
85 
91  void detach();
92 
100  void write(int angleArg);
101 
110  void setMinimumPulse(uint16_t t);
111 
120  void setMaximumPulse(uint16_t t);
121 
129  static void refresh();
130 };
131 
132 #endif
uStepperServo::refresh
static void refresh()
Updates servo output pins.
Definition: uStepperServo.cpp:152
uStepperServo::attach
uint8_t attach(int pinArg)
Attaches the servo motor to a specific pin.
Definition: uStepperServo.cpp:118
uStepperServo::detach
void detach()
Detaches the servo motor from the uStepper.
Definition: uStepperServo.cpp:130
uStepperServo::write
void write(int angleArg)
Specify angle of servo motor.
Definition: uStepperServo.cpp:141
uStepperServo::setMaximumPulse
void setMaximumPulse(uint16_t t)
Sets the maximum pulse.
Definition: uStepperServo.cpp:113
uStepperServo::setMinimumPulse
void setMinimumPulse(uint16_t t)
Sets the minimum pulse.
Definition: uStepperServo.cpp:108
uStepperServo::next
class uStepperServo * next
Definition: uStepperServo.h:57
uStepperServo::first
static uStepperServo * first
Definition: uStepperServo.h:60
uStepperServo
Prototype of class for ustepper servo.
Definition: uStepperServo.h:41
uStepperServo::uStepperServo
uStepperServo()
Constructor for servo class.
Definition: uStepperServo.cpp:103
uStepperServo::min16
uint8_t min16
Definition: uStepperServo.h:51
uStepperServo::pin
uint8_t pin
Definition: uStepperServo.h:45
uStepperServo::max16
uint8_t max16
Definition: uStepperServo.h:53
uStepperServo::angle
uint8_t angle
Definition: uStepperServo.h:47
uStepperServo::pulse
uint16_t pulse
Definition: uStepperServo.h:49