]> git.piffa.net Git - rover/blob - libraries/rover/rover.h
acde54fcf86c59cc804a688e58a8c67044f23972
[rover] / libraries / rover / rover.h
1 /*
2   Rover 
3
4 Autore: Andrea Manni
5
6 Link: http://rover.piffa.net
7 Licenza:    GPLv3
8
9 */
10
11 #include "Arduino.h"
12
13 #ifndef rover_h
14 #define rover_h
15
16 //////////////////////
17 // OBJ
18
19
20 class engine {
21 // Gestione di un singolo motore
22 private:
23     byte enablePIN1;
24     byte enablePIN2;
25     byte min;   // Minimo per partire
26     byte val;   // 8bit PWM
27
28 public:
29     Engine (byte PIN1, byte PIN2, byte PINPWM);
30     void Forward ();
31     void Backward ();
32     void SetSpeed (); // imposta un valore preciso per il PWM
33
34 }
35
36 class motors {
37 // classe composta da due engines
38 // Composition is better than inheritance here
39
40 public:
41     motors (engine enginesx, engine enginedx) {
42     void Forward ();
43     void Backward ();
44     void TurnLeft ();
45     void TurnRight ();
46     void TurnU ();
47 }
48 }
49 //////////////////////
50 // Funzioni
51
52
53 #endif