-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPSCS_Freefall.cpp
67 lines (59 loc) · 1.31 KB
/
PSCS_Freefall.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* @file PSCS_Freefall.cpp
* @author SeungMin Shin, Haneulbit Kim, Chan Lee
* @license This project is released under the MIT License (MIT)
* @copyright Copyright (c) 2018 Asgardia
* @date June 2018
* @brief ...
*
*/
#include "PSCS_Freefall.h"
/************************/
/* TskFreeFall class */
/************************/
TskFreeFall::TskFreeFall(){}
void TskFreeFall::begin(int pin)
{
_manager_servo.attach(pin);
}
void TskFreeFall::readyPosition()
{
Serial.println(F("readyPosition"));
_manager_servo.servoReady();
}
void TskFreeFall::hookingPosition(){
_manager_servo.servoHooking();
}
void TskFreeFall::releasePosition(){
_manager_servo.servoRelease();
}
/************************/
/* MngFreeFall class */
/************************/
MngFreeFall::MngFreeFall(){}
void MngFreeFall::attach(int pin)
{
_pin=pin; //keep pin number
_myservo.attach(pin); //attach data pin to my servo
}
void MngFreeFall::servoReady()
{
_myservo.attach(_pin);
_myservo.write(90);
delay(200);
_myservo.detach();
}
void MngFreeFall::servoHooking()
{
_myservo.attach(_pin);
_myservo.write(180);
delay(200);
_myservo.detach();
}
void MngFreeFall::servoRelease()
{
_myservo.attach(_pin);
_myservo.write(20);
delay(200);
_myservo.detach();
}