]> git.piffa.net Git - rover/blob - prototypes/macchina/raw/raw.ino
Primo prototipo raw
[rover] / prototypes / macchina / raw / raw.ino
1 /* Raw
2
3 Prototipo rozzo per il movimento utilizzando le funzioni
4 di base della libreria Rover.
5
6
7 Schema: https://lab.piffa.net/schemi/2wd_car_bb.png
8 Codice: http://git.andreamanni.com/web?p=rove
9
10 */
11
12
13 #include "rover.h"
14 #include "Servo.h"
15
16 int rotPausa = 100; // Pausa per una rotazione di ~90'
17
18 void setup()
19 {
20     abilita();
21     servoMiddle();
22 }
23
24
25 void loop()
26 {
27 // Fintanto che non ci sono ostacoli: avanti
28     while (check() = 0) {
29         avanti()
30     }
31 // Se c'e' un ostacolo: ferma e gira
32     stop();
33     giraSX;
34     delay(rotPausa);
35 }