-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDevBot.h
90 lines (76 loc) · 1.69 KB
/
DevBot.h
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#ifndef WIRING_H
#include <Servo.h>
#include <Arduino.h>
#endif
#include "Modo.h"
#include "Motores.h"
enum Bateria { bateria_6_volts,
bateria_7_volts,
bateria_9_volts,
bateria_12_volts};
enum Motor { motor_6_volts,
motor_9_volts,
motor_12_volts};
enum Placa { programME_v2,
arduino};
enum Sensor { sensor_distancia_parallax,
sensor_distancia_tato,
sensor_luz,
sensor_temperatura};
enum Servos { servo_comum};
struct Portas {
byte motor1A;
byte motor1B;
byte motor1PWM;
byte motor2A;
byte motor2B;
byte motor2PWM;
byte servo;
byte sensorLuz;
byte sensorTemperatura;
byte sensorDistancia1;
byte sensorDistancia2;
byte speaker;
};
class DevBot {
private:
public:
Servo servo;
Portas portas;
Motores motores;
Modo modos[5];
Placa placa;
Sensor sensor;
int temServo;
int modoAtual;
int ultimoModo;
int contadorModos;
byte modoMudou;
DevBot();
void iniciar();
void configurar(Bateria bateria);
void configurar(Motor motor);
void configurar(Placa placa);
void configurar(Portas portas);
void configurar(Servos servo);
void configurar(Sensor sensor);
void esperar(long);
void loop();
void beep(int);
byte mudouModo();
void checarMudancaModo();
void modo(int numeroModo, void(*modo)());
long sensorDistancia1();
long sensorLuz();
long sensorTemperatura();
void mudarServo(int posicao);
void enviar(int);
void enviar(long);
void enviar(char);
void enviar(char*);
int recebeuComando(char*);
void controleRemoto();
char* receber();
int recebeuDados();
};
extern DevBot robot;