-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAMADefines.h
70 lines (49 loc) · 1.26 KB
/
AMADefines.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
#ifndef __AMADefines__
#define __AMADefines__
#include <Arduino.h>
typedef unsigned char byte;
typedef unsigned long ulong;
#define DEBUG 0
#define SECOND_HALF_MS 500
#define SECOND_FULL_MS 1000
#define TIMEOUT_BETWEEN_COMMANDS_MS 5000
#define DC_MOTOR_FORWARD B10
#define DC_MOTOR_BACKWARD B01
#define DC_MOTOR_STOP B11
#define DC_MOTOR_BUS_PIN_LSB 2
#define DC_MOTOR_BUS_PIN_MSB 4
#define DC_MOTOR_RIGHT_PWM_PIN 3
#define DC_MOTOR_LEFT_PWM_PIN 5
// if car turns left, then increase right motors pwm with this value
// if car turns right, then increase left motors pwm with this value
#define DC_MOTOR_TURN_SPEEDUP 10 // percent
#define SERVO_MOTOR_LEFT 135
#define SERVO_MOTOR_FRONT 95
#define SERVO_MOTOR_RIGHT 55
#define SERVO_MOTOR_PWM_PIN 9
#define ARDUINO_BT_PIN_TX 11
#define ARDUINO_BT_PIN_RX 12
#define DEFAULT_BAUD_RATE 9600
// arduino duty cycle min/max percents
#define CAR_SPEED_LOWEST_PERCENT 40
#define CAR_SPEED_HIGHEST_PERCENT 100
// android seek bar min/max values
#define CAR_SPEED_LOWEST_VALUE 0
#define CAR_SPEED_HIGHEST_VALUE 10
#define LIGHTS_FRONT_PIN 6
#define LIGHTS_BACK_PIN 7
#define BUZZER_PIN 8
#define BUZZER_FREQ_HZ 1000
#endif
/*
+-------+
| ^ |
|< >|
| v |
+-------+
+--------+
|11 12 13|
|21 22 23|
|31 32 33|
+--------+
*/