-
Notifications
You must be signed in to change notification settings - Fork 1
/
dance.ino
69 lines (56 loc) · 1.22 KB
/
dance.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
Dance.ino - Make elegoo smart robot car v1.0 dance
Created by Pablo Gambetta December 2016
Released into the public domain.
*/
#include <Drivelib.h>
// [esp] Incluir drivelib
// [eng] Include drivelib
Drivelib drivelib;
/**
* [esp] Funcion de configuracion. Corre unicamente una vez.
* [eng] Setup function. Only run once.
*/
void setup() {
// [esp] Abrir el puerto serial y establecer la velocidad en baudios a 9600
// [eng] Open the serial port and set the baud rate to 9600
Serial.begin(9600);
}
/**
* [esp] Funcion principal. Corre indefinidamente.
* [eng] Main function. Runs repeatedly.
*/
void loop() {
// [esp] Ir hacia adelante
// [eng] Go foward
drivelib.forward();
delay(500);
// [esp] Parar
// [eng] Stop
drivelib.stop();
delay(2000);
// [esp] Ir hacia atras
// [eng] Go back
drivelib.backward();
delay(500);
// [esp] Parar
// [eng] Stop
drivelib.stop();
delay(2000);
// [esp] Ir hacia la izquierda
// [eng] Go left
drivelib.left();
delay(500);
// [esp] Parar
// [eng] Stop
drivelib.stop();
delay(2000);
// [esp] Ir hacia la derecha
// [eng] Go right
drivelib.right();
delay(500);
// [esp] Parar
// [eng] Stop
drivelib.stop();
delay(2000);
}