PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Motor
libservo360
servo360_couple.c
1
/*
2
@file servo360_couple.c
3
4
@author Parallax Inc
5
6
@copyright
7
Copyright (C) Parallax Inc. 2017. All Rights MIT Licensed. See end of file.
8
9
@brief
10
*/
11
12
13
#include "
simpletools.h
"
14
#include "
servo360.h
"
15
16
17
int
servo360_couple
(
int
pinA,
int
pinB)
18
{
19
if
(!_fb360c.servoCog) servo360_run();
20
21
int
pA = servo360_findServoIndex(pinA);
22
if
(pA == -1)
return
-1;
23
int
pB = servo360_findServoIndex(pinB);
24
if
(pB == -1)
return
-2;
25
26
if
(pA < pB)
27
{
28
_fs[pA].couple = pB;
29
_fs[pA].coupleScale = S360_SCALE_COUPLE;
30
return
pB;
31
}
32
else
if
(pB < pA)
33
{
34
_fs[pB].couple = pA;
35
_fs[pB].coupleScale = S360_SCALE_COUPLE;
36
return
pA;
37
}
38
else
39
{
40
return
-3;
41
}
42
}
43
44
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
servo360_couple
int servo360_couple(int pinA, int pinB)
This function is used by the abdrive360 library to reduce the drive on a servo whose position is furt...
Definition:
servo360_couple.c:17
servo360.h
Parallax Feedback 360 High Speed Servo control and monitoring functions. Uses one additional cog to c...
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17