X-Git-Url: http://git.piffa.net/web?p=rover;a=blobdiff_plain;f=libraries%2Frover%2Frover.h;h=54463597e64987b87e8fe27ca79e18f117ce2cac;hp=7d5da82a795c2f7ddbba35bc394819a5bb5e9c70;hb=bb56af759cd0aac42aed4e6666ef2e4ffc7c9ef7;hpb=d4f770ac3314d197b2563054a837093f17914dc4 diff --git a/libraries/rover/rover.h b/libraries/rover/rover.h index 7d5da82..5446359 100644 --- a/libraries/rover/rover.h +++ b/libraries/rover/rover.h @@ -1,5 +1,5 @@ /* - Rover + Rover Autore: Andrea Manni @@ -14,6 +14,14 @@ Licenza: GPLv3 #define rover_h // Global vars +extern int enA ; +extern int in1 ; +extern int in2 ; +extern byte speedA ; +// motor two +extern int enB ; +extern int in3 ; +extern int in4 ; // Funzioni @@ -30,4 +38,30 @@ void backwardB() ; void backwardB(byte speedB) ; void stopB() ; +// Objects: + + +class car { +// Lettura delle variabili globali (per poter tenere un file +// di configurazione con tutti i PIN) +// motor one + const int _enA = enA ; + const int _in1 = in1 ; + const int _in2 = in2 ; +// motor two + const int _enB = enB ; + const int _in3 = in3 ; + const int _in4 = in4 ; + +public: + car () ; + byte velA ; + byte velB ; + void avanti (); + void indietro (); + void stop (); + void giraSX (); + void giraDX (); + void setSpeed (); +}; #endif