]> git.piffa.net Git - rover/commitdiff
Sistemati gli include della lib Servo.h
authorAndrea Manni <andrea@piffa.net>
Wed, 5 Apr 2017 10:51:46 +0000 (12:51 +0200)
committerAndrea Manni <andrea@piffa.net>
Wed, 5 Apr 2017 11:00:57 +0000 (13:00 +0200)
libraries/rover/keywords.txt
libraries/rover/rover.cpp
libraries/rover/rover.h
prototypes/servo/rotation_lib/rotation_lib.ino

index 591e2036d24d55fd745bb8a7372fba2f97e8ce2e..d698c4007cb551a8794c13895a66b27de3246811 100644 (file)
@@ -1 +1,25 @@
-toggleRead                     KEYWORD2        
+toggleRead                     KEYWORD2
+abilita                                KEYWORD2
+forwardA                       KEYWORD2
+forwardA                       KEYWORD2
+backwar                                KEYWORD2
+backwardA                      KEYWORD2
+stopA                          KEYWORD2
+forwardB                       KEYWORD2
+forwardB                       KEYWORD2
+backwardB                      KEYWORD2
+backwardB                      KEYWORD2
+stopB                          KEYWORD2
+
+turnDX                         KEYWORD2
+turnSX                         KEYWORD2
+turnMiddle                     KEYWORD2
+myservo                                KEYWORD1
+
+car                            KEYWORD1
+avanti                         KEYWORD2
+indietro               KEYWORD2
+stop                   KEYWORD2
+giraSX                         KEYWORD2
+giraDX                         KEYWORD2
+setSpeed               KEYWORD2
index f284162b970330d6352509e4194283434c4b5b18..d95fe065190912808ab355e57e2843965a97bd73 100644 (file)
@@ -24,8 +24,17 @@ const int enB = 5;
 const int in3 = 4;
 const int in4 = 3;
 byte speedB = 255;
-// Funzioni
 
+// Servo vars
+int pos = 0;    // variable to store the servo position 
+const byte servoPIN =9 ;
+const byte middle = 90; // Centratura servo
+const int spausa = 30; // Pausa movimenti servo
+Servo myservo; // Non c'e' bisogno di extern se e' dichiarato in questo scope
+
+////////////////////////
+// Funzioni:
+//
 void abilita() {
 // Abilita i PINs come OUTPUTS
     pinMode(enA, OUTPUT);
@@ -34,6 +43,10 @@ void abilita() {
     pinMode(enB, OUTPUT);
     pinMode(in3, OUTPUT);
     pinMode(in4, OUTPUT);
+
+
+    pinMode(servoPIN, OUTPUT);
+    myservo.attach(servoPIN);
 }
 
 
index a4ad42bd1b6bdf73b51b084a43cc70ca568f2af5..ce72cdbfecb6524dc0ae1640b0f3dc90d3d4f8da 100644 (file)
@@ -9,6 +9,7 @@ Licenza:    GPLv3
 */
 
 #include "Arduino.h"
+#include "Servo.h" 
 
 #ifndef rover_h
 #define rover_h
index 130d38dd1ea4e6ce67e2b71d8e1740753c292f8a..763e8f2d3e52aa9ce4cbed7ac5b1dbb2610acc86 100644 (file)
 
 
 #include <rover.h>
-#include <Servo.h> 
+#include "Servo.h" 
 
-Servo myservo;  // create servo object to control a servo 
 // a maximum of eight servo objects can be created 
 
-// Servo vars
-int pos = 0;    // variable to store the servo position 
-const byte servo =9 ;
-const byte middle = 90; // Centratura servo
-const int spausa = 30; // Pausa movimenti servo
 
 void setup() 
 {