VizBlocks
ServoBehaviours.hpp
Go to the documentation of this file.
1 #ifndef SERVO_BEHAVIOUR_h
2 #define SERVO_BEHAVIOUR_h
3 #include "Arduino.h"
4 #include "Behaviours.h"
5 
6 #include <Servo.h>
12 class ServoGoto : public Behaviour
13 {
14  Servo _servo;
15 
16 public:
17  ServoGoto(Servo servo, String name = "ServoGoto");
21  char* args();
22  String start(String args);
23 
24 };
25 
26 class ServoWiggle : public Behaviour
27 {
28  Servo _servo;
29  int _start_time = 0;
30  int _wiggle_time = 300;
31  int _num_wiggles = 5;
32  int _wiggles = 0;
33  int _wiggle_angle = 0;
34  //Calculate wiggle time by multiplying the angle by this...
35  int _wiggle_factor = 5;
36 
37 public:
38  ServoWiggle(Servo servo, String name = "ServoWiggle", int slowness=3);
42  char* args();
46  String start(String args);
50  void update();
51 
52 };
53 
55 {
56  Servo _servo;
57  int _start_angle = 0;
58  int _end_angle = 180;
59  int _delay = 30;
60  int _num_rotations = 1;
61  int _rotations = 0;
62  int _pause = 500;
63 
64 public:
65  ServoRotateReturn(Servo servo, String name="ServoRotateReturn", int delay=30, int pause=500, int start_angle = 2, int end_angle=178 );
69  char* args();
73  String start(String args);
77  void update();
78 };
79 
80 #endif
ServoRotateReturn::ServoRotateReturn
ServoRotateReturn(Servo servo, String name="ServoRotateReturn", int delay=30, int pause=500, int start_angle=2, int end_angle=178)
Behaviour::name
virtual String name()
ServoWiggle::update
void update()
What does this do?
ServoRotateReturn
Definition: ServoBehaviours.hpp:55
ServoWiggle::start
String start(String args)
What does this do?
ServoRotateReturn::args
char * args()
What does this do?
Behaviour
Definition: Behaviours.hpp:9
ServoWiggle::ServoWiggle
ServoWiggle(Servo servo, String name="ServoWiggle", int slowness=3)
ServoRotateReturn::update
void update()
What does this do?
ServoGoto
Definition: ServoBehaviours.hpp:13
ServoWiggle::args
char * args()
What does this do?
ServoGoto::ServoGoto
ServoGoto(Servo servo, String name="ServoGoto")
ServoWiggle
Definition: ServoBehaviours.hpp:27
ServoRotateReturn::start
String start(String args)
What does this do?
ServoGoto::start
String start(String args)
ServoGoto::args
char * args()
What does this do?