aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-01-02 22:28:15 +0100
committerDimitri Sokolyuk <demon@dim13.org>2017-01-02 22:28:15 +0100
commit3414b9c99699327096b833ae7bd8421ce925e678 (patch)
treea0b7ba25ab9c13864ebcdf45d9940a34e2b1ac72
parent1fe07a6eabb4f6a7d339cc38ab6789d33d030697 (diff)
Split config
-rw-r--r--car/car.ino48
-rw-r--r--car/config.h51
2 files changed, 52 insertions, 47 deletions
diff --git a/car/car.ino b/car/car.ino
index b6a228f..89fd9c6 100644
--- a/car/car.ino
+++ b/car/car.ino
@@ -3,53 +3,7 @@
#include <Servo.h>
#include <IRremote.h>
-
-// Settings
-#define dist 20
-#define velo 130
-
-// Pinout motor
-#define ENA 5 // 10 pwm
-#define ENB 6 // 5 pwm
-
-#define IN1 7 // 9
-#define IN2 8 // 8
-#define IN3 9 // 7
-#define IN4 10 // 6
-
-// Pinout sensors
-#define S1 2
-#define S2 4
-#define S3 11
-
-// Pinout IR
-#define IR 12
-
-#define KeyUp 0x00511DBB
-#define KeyDown 0xA3C8EDDB
-#define KeyLeft 0x52A3D41F
-#define KeyRight 0x20FE4DBB
-#define KeyOk 0xD7E84B1B
-#define Key0 0x1BC0157B
-#define Key1 0xC101E57B
-#define Key2 0x97483BFB
-#define Key3 0xF0C41643
-#define Key4 0x9716BE3F
-#define Key5 0x3D9AE3F7
-#define Key6 0x6182021B
-#define Key7 0x8C22657B
-#define Key8 0x488F3CBB
-#define Key9 0x0449E79F
-#define KeyStar 0x97483BFB
-
-
-// Pinout Ultrasonic
-#define Echo A1
-#define Trig A0
-
-#define ToCM 58
-#define ToInch 148
-#define TimeOut 100000
+#include "config.h"
Servo head;
IRrecv irrecv(IR);
diff --git a/car/config.h b/car/config.h
new file mode 100644
index 0000000..7165d31
--- /dev/null
+++ b/car/config.h
@@ -0,0 +1,51 @@
+#ifndef CONFIG_H
+#define CONFIG_H
+
+// Settings
+#define dist 20
+#define velo 130
+
+// Pinout motor
+#define ENA 5 // 10 pwm
+#define ENB 6 // 5 pwm
+
+#define IN1 7 // 9
+#define IN2 8 // 8
+#define IN3 9 // 7
+#define IN4 10 // 6
+
+// Pinout sensors
+#define S1 2
+#define S2 4
+#define S3 11
+
+// Pinout IR
+#define IR 12
+
+#define KeyUp 0x00511DBB
+#define KeyDown 0xA3C8EDDB
+#define KeyLeft 0x52A3D41F
+#define KeyRight 0x20FE4DBB
+#define KeyOk 0xD7E84B1B
+#define Key0 0x1BC0157B
+#define Key1 0xC101E57B
+#define Key2 0x97483BFB
+#define Key3 0xF0C41643
+#define Key4 0x9716BE3F
+#define Key5 0x3D9AE3F7
+#define Key6 0x6182021B
+#define Key7 0x8C22657B
+#define Key8 0x488F3CBB
+#define Key9 0x0449E79F
+#define KeyStar 0x97483BFB
+
+
+// Pinout Ultrasonic
+#define Echo A1
+#define Trig A0
+
+#define ToCM 58
+#define ToInch 148
+#define TimeOut 100000
+
+#endif