-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.h
278 lines (226 loc) · 6.16 KB
/
config.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
/****************************************************
Busputer Configuration
for detailed informations see
https://github.com/brvdg/busputer/wiki
****************************************************/
/*
Hardware configuration
*/
// Display Configuration
#define U8G2_DISPLAY
//#define DOGS102
//#define OLED
//#define NOKIA
// Port defination
//#ifdef U8G2_DISPLAY
//#define U8G2_DISPLAY_BG_LED 10 //turn this off if a OLED ist used
#define U8G2_DISPLAY_CS 11
#define U8G2_DISPLAY_DC 12
#define U8G2_DISPLAY_RST 10
// defination of LCD dimmer
#define DIMMER 2 //Port for the cluster dimmer source
#define DIMMER_MAX_mV 13800
#define DIMMER_MIN_mV 4000
#define DIMMER_MAX 150
#define DIMMER_MIN 20
#define CLOCK_VIEW 1 // 1 = clock and temperature / 0 = clock and date
//#endif // U8G2_DISPLAY
// SD Card
#define SDCARD
#define SD_CS 4
//TinyGSM configuration
#define TinyGSM
#define SIM_APN "Provider_APN"
#define SIM_USER "Provider_USER"
#define SIM_PASS "Provider_PASSWORD"
#define SMS_Keyword "keyword"
#define BLYNK_KEY "0123456789abcdefghijkl"
#define MYNUMBER "+4917123456789"
#define BLYNK_DEVICE_NAME "MyCar"
// if this is turned on
// we are online if the car is turned off
#define ONLINE_INTERVALL 3 // interval in min
//#define GEO_FENCE_DISTANCE 50 // im ms-m
/*
Temperature source
0 = disabled / auto
1 = OneWire
2 = SI7021
*/
#define TEMP_OUT_PORT 0
/*
Speed source
1 = Speedpulse
2 = GPS
*/
#define SPEEDSOURCE 2
#define SPEED_OFFSET 0
// Speedpulse Port
#define SPEEDPULSE_PORT 6
#define SPEEDPULSEARRAY 25
// RPM gauge
#define RPM_PORT 5
#define RPM_MULTIPL 2
// Water Temp gauge
#define WATER_TEMP 4
#define SERIESRESISTOR 50 // Ohm of the original gauge
#define WATER_TEMP_WARNING 110
// Fuel gauge
#define FUEL_GAUGE_PORT 3
#define FUEL_GAUGERESISTOR 55
#define FUEL_FULL 34
#define FUEL_EMPTY 168
#define FUEL_L 60
#define FUEL_WARNING 15
// Alarm output
#define ALARM_OUT
#define ALARM_PORT 13
//#define ALARM_DISPLAY
// bord voltage
#define BORD_VOLTAGE_PORT 1
// OIL
#define OIL_TEMP_PORT 0
#define OIL_PRESSURE_PORT 0
#define OIL_PRESSURE_WARNING 2
#define OIL_TEMP_WARNING 130
// LED on Feather board for running status
#define FeatherLED8 8
// Port for Button input
#define BUTTON_PIN_1 9
// for Dalles DS18B20 Temperatursensor
#define ONEWIRE
#define ONE_WIRE_BUS 6
// I2S Sensors
#define I2C
#define SI7021
/*
analog input multiplicator
A0/A1 range 0-15.6V
15.6 / 1024 = 0.015234
A2/A3 range 0-10V
10 / 1024 = 0.009765
*/
#define A0_MULTIPLICATOR 0.015234
#define A1_MULTIPLICATOR 0.015234
#define A2_MULTIPLICATOR 0.009765
#define A3_MULTIPLICATOR 0.009765
// Number of values for an average
#define IO_ARRAY 25
// enable Debugging
//#define OFFLINE // disable some functions for programming and testing
/*#define INFO
#define DEBUG
#define TINYGSM_DEBUG
#define SD_DEBUG
#define TRACE*/
#ifdef TINYGSM_DEBUG
#define BLYNK_PRINT Serial // Defines the object that is used for printing
#define BLYNK_DEBUG // Optional, this enables more detailed prints
#endif
// print the status on serial port
//#define PRINT_STATUS
/*
Watchdog
This is not the AProvider_PASSWORDel internal Watchdag.
The Watchdog is based on an timer interrrupt
*/
#define WATCHDOG_TIMER 120 * 1000 // 120s
//#define WATCHDOG_TIMER 10000 // 10s
/*
Blynk virtual Ports defination
*/
/*
* Blynk definations
*/
#ifdef TinyGSM
// Select your modem:
//#define TINY_GSM_MODEM_SIM800
#define TINY_GSM_MODEM_SIM808
//#define TINY_GSM_MODEM_SIM900
//#define TINY_GSM_MODEM_A6
//#define TINY_GSM_MODEM_M590
#include <TinyGsmClient.h>
#include <BlynkSimpleSIM800.h>
#endif // TinyGSM
#define BLYNK_VIRTUAL_terminal V0
#define BLYNK_VIRTUAL_map V1
#define BLYNK_VIRTUAL_gps_used_satellites V2
#define BLYNK_VIRTUAL_gps_view_satellites V3
#define BLYNK_VIRTUAL_gps_latitude V4
#define BLYNK_VIRTUAL_gps_longitude V5
#define BLYNK_VIRTUAL_gps_altitude V6
#define BLYNK_VIRTUAL_bord_voltage V7
#define BLYNK_VIRTUAL_stay_online V8
#define BLYNK_VIRTUAL_online_LED V9
#define BLYNK_VIRTUAL_geoalarm_modus V10
#define BLYNK_VIRTUAL_geo_fence_armed_led V11
#define BLYNK_VIRTUAL_geo_fence_distance V12
#define BLYNK_VIRTUAL_geo_fence_led V13
#define BLYNK_VIRTUAL_alarm V14
#define BLYNK_VIRTUAL_armed_led V15
#define BLYNK_VIRTUAL_alarm_led V16
#if defined (DOGS102) && defined (OLED)
#pragma message ( "Only one display can be configured" )
#error "Only one display can be configured"
#endif
//#if defined (U8G2_DISPLAY_BG_LED) && defined (OLED)
//#pragma message ( "U8G2_DISPLAY_BG_LED and OLDE can't used together" )
//#error "U8G2_DISPLAY_BG_LED and OLED can't used together"
//#endif
/*
Timer for the seperate Tasks
*/
#define U8G2_DISPLAY_UPDATE_TIMER 40 // 200ms
#define PRINT_STATUS_TIMER 2000 //
#define UPDATE_VARS_TIMER 200 // 200ms
#define BUTTON_TIMER 200 // 200ms
#define I2C_TIMER 200 // 200ms
#define ONEWIRE_TIMER 500 // 5s
#define ANALOG_TIMER 1000 // 1000ms
#define IO_TIMER 200 // 200ms
#define ALARM_TIMER 100 // 100ms
#define LOG_TIMER 1000 // 1s
#define STATUS_CHECKER_TIMER 200 // 200ms
#define TinyGSM_GPS_TIMER 1000 // 1s
#define TinyGSM_SMS_TIMER 5000 // 5s
#define TinyGSM_BATT_TIMER 30000 // 30s
#define TinyGSM_BLYNK_TIMER 5000 // 5s
//#define TinyGSM_GPS_STATUS_TIMER 3000 // 3s
#define BLYNK_CHECK_TIMER 600000 // 10min
#ifdef INFO
#define INFO_PRINT(x) Serial.print (x)
#define INFO_PRINTLN(x) Serial.println (x)
#define INFO_PRINTHEX(x) Serial.print (x, HEX)
#else
#define INFO_PRINT(x)
#define INFO_PRINTLN(x)
#define INFO_PRINTHEX(x)
#endif
#ifdef DEBUG
#define DEBUG_PRINT(x) Serial.print (x)
#define DEBUG_PRINTLN(x) Serial.println (x)
#else
#define DEBUG_PRINT(x)
#define DEBUG_PRINTLN(x)
#endif
#ifdef TINYGSM_DEBUG
#define TINYGSM_DEBUG_PRINT(x) Serial.print (x)
#define TINYGSM_DEBUG_PRINTLN(x) Serial.println (x)
#else
#define TINYGSM_DEBUG_PRINT(x)
#define TINYGSM_DEBUG_PRINTLN(x)
#endif
#ifdef SD_DEBUG
#define SD_DEBUG_PRINT(x) Serial.print (x)
#define SD_DEBUG_PRINTLN(x) Serial.println (x)
#else
#define SD_DEBUG_PRINT(x)
#define SD_DEBUG_PRINTLN(x)
#endif
#ifdef TRACE
#define TRACE_PRINT(x) Serial.print (x)
#define TRACE_PRINTLN(x) Serial.println (x)
#else
#define TRACE_PRINT(x)
#define TRACE_PRINTLN(x)
#endif