uStepper S
uStepperServo.h
Go to the documentation of this file.
1/********************************************************************************************
2* File: uStepperServo.h *
3* Version: 2.3.0 *
4* Date: December 27th, 2021 *
5* Authors: Thomas Hørring Olsen *
6* Emil Jacobsen *
7* *
8*********************************************************************************************
9* (C) 2021 *
10* *
11* uStepper ApS *
12* www.ustepper.com *
13* administration@ustepper.com *
14* *
15* The code contained in this file is released under the following open source license: *
16* *
17* Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International *
18* *
19* The code in this file is provided without warranty of any kind - use at own risk! *
20* neither uStepper ApS nor the author, can be held responsible for any damage *
21* caused by the use of the code contained in this file ! *
22* *
23********************************************************************************************/
34#ifndef _USTEPPERSERVO_H
35#define _USTEPPERSERVO_H
36
37#include <Arduino.h>
38#include <inttypes.h>
39
40#define TIMERTOP 39850.0f
41#define TIMERPERIOD 20000.0f //period in us
42#define TICKSTOUS TIMERTOP/TIMERPERIOD
43
48{
49 private:
51 uint8_t angle;
53 uint16_t pulse;
55 uint16_t min16;
57 uint16_t max16;
58
59 public:
60
61 void setup(void);
62
71
79 void write(int angleArg);
80
89 void setMinimumPulse(float us);
90
99 void setMaximumPulse(float us);
100};
101
102#endif
Prototype of class for ustepper servo.
Definition: uStepperServo.h:48
uStepperServo()
Constructor for servo class.
void write(int angleArg)
Specify angle of servo motor.
uint16_t min16
Definition: uStepperServo.h:55
void setMinimumPulse(float us)
Sets the minimum pulse.
void setup(void)
void setMaximumPulse(float us)
Sets the maximum pulse.
uint16_t pulse
Definition: uStepperServo.h:53
uint16_t max16
Definition: uStepperServo.h:57