firmwareSandsara
config.h
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef HEADER_H
4 #define HEADER_H
5 
8 #define v1Current 1
9 #define v2Current 0
10 #define v3Current 6
11 
12 extern char dataS[];
13 
18 #define TESTINGPLAYLIST "/SandsaraTesting.playlist"
19 #define DEFAULTPLAYLIST "/playlist.playlist"
20 
29 //Es el valor de la resistencia colocada en los drivers, por ejemplo 0.11f representa 0.11 ohms.
30 #define R_SENSE 0.11f
31 
32 //STALL_VALUE y STALL_VALUE2 es la sensibilidad para la deteccion de colision la cual tambien depende de la corriente.
33 #define STALL_VALUE 2 // [0..255]
34 #define STALL_VALUE2 2
35 
36 //MICROSTEPPING es para configurar las distintas configuraciones de de microstepping que tiene el motor
37 // entre las opciones estan 1,2,4,8,16,32,64.
38 extern int MICROSTEPPING;
39 
45 extern int l1;
46 extern int l2;
47 
52 extern double MAX_RADIO;
53 extern double RESOLUCION_MAX;
54 
63 extern double bigPulleySize;
64 extern double littlePulleySize;
65 
75 #define DIR_PIN 33
76 #define STEP_PIN 25
77 #define EN_PIN 14
78 #define DIR_PIN2 4
79 #define STEP_PIN2 21
80 #define EN_PIN2 15
81 
82 // number of tracks to be played before the calibration is performed
83 #define TRACKS_BEFORE_CALIBRATION 12
84 
85 //no_picos representa el numero de picos de Stelle
86 #define no_picos 6
87 
94 // #define PROCESSING_SIMULATOR
95 #define DEBUGGING_DATA
96 //#define DEBUGGING_DETAIL
97 //#define DISABLE_MOTORS
98 //#define DEBUGGIN_LED2
99 #define IMPLEMENT_ACCELERATION
100 #define RESQUEST_ANSWER
101 #define DEBUGGING_BLUETOOTH
102 
107 #define hall1 39
108 #define hall2 36
109 
114 #define DIAG_PIN 34
115 #define DIAG_PIN2 22
116 
117 #define SERIAL_PORT Serial1 // TMC2208/TMC2224 HardwareSerial port
118 #define DRIVER_ADDRESS 0b00 // TMC2209 Driver address according to MS1 and MS2
119 
120 
121 #define SERIAL_PORT2 Serial2 // TMC2208/TMC2224 HardwareSerial port
122 #define DRIVER_ADDRESS2 0b00 // TMC2209 Driver address according to MS1 and MS2
123 
124 #define radius_1 152.0
125 #define radius_2 100.0
126 
127 #define PIN_ProducType 35
128 
132 #define EEPROM_SIZE 512
133 
134 #define ADDRESSPLAYLIST 0
135 #define ADDRESSPOSITION 41
136 #define ADDRESSORDERMODE 50
137 #define ADDRESSPALLETE 60
138 #define ADDRESSSPEEDMOTOR 70
139 #define ADDRESSPERIODLED 80
140 #define ADDRESSBTNAME 90
141 #define ADDRESSINTERMEDIATECALIBRATION 140
142 #define ADDRESSPOSITIONLIST 150 //4 bytes
143 #define ADRESSLEDSDIRECTION 160 //1 byte
144 #define ADDRESSCUSTOMPALLETE_COLORS 199
145 #define ADDRESSCUSTOMPALLETE_INCREMENTINDEX 198
146 #define ADDRESSCUSTOMPALLETE_POSITIONS 200
147 #define ADDRESSCUSTOMPALLETE_RED 216
148 #define ADDRESSCUSTOMPALLETE_GREEN 232
149 #define ADDRESSCUSTOMPALLETE_BLUE 248
150 #define ADDRESSPOLESENSE1 401
151 #define ADDRESSPOLESENSE2 402
152 #define ADDRESSESTOVERIFY 14
153 #define ADDRESSBRIGHTNESS 170 //1 byte
154 
155 
159 extern int MAX_CHARS_PLAYLIST;
160 extern int MAX_SPEED_MOTOR;
161 extern int MIN_SPEED_MOTOR;
162 extern int MAX_PERIOD_LED;
163 extern int MIN_PERIOD_LED;
164 extern int MAX_PALLETE;
165 extern int MIN_PALLETE;
166 extern int MAX_CHARACTERS_BTNAME;
167 extern int MIN_REPRODUCTION_MODE;
168 extern int MAX_REPRODUCTION_MODE;
169 extern int MAX_POSITIONLIST;
170 extern int LEDS_OF_HALO;
171 extern int LEDS_OF_STELLE;
172 extern int MAX_STEPS_PER_SECOND;
173 extern int MAX_CHARACTER_PER_LINE;
174 extern int OUTOFTIME_BLUETOOTH;
175 extern int OUTOFTIME_BLUETOOTH_LINE;
176 extern int NORMAL_CURRENT;
177 extern int CURRENT_IN_CALIBRATION;
178 
179 
180 //
181 #define ACCEL_THRESHOLD 500.0
182 #define SAFE_SPEED 1.0
183 #define MAX_STEPS_PER_INSTRUCTION 100.0
184 #define SAMPLES 50
185 #define CHUNKSIZE 512
186 #define MAX_LED_SUM 538
187 #define TIME_WAITFORSD 1000
188 #define FILENAME_BASE "Sandsara-trackNumber-"
189 #define SPEED_WHEN_IS_CONNECTED_TO_BLE 25
190 #define THREAD_LEDS_TIME 10 //in milliseconds
191 #define MAX_DISTANCE_FOR_MOVEMENT 2.5 //this distance is in milimeters and it represents the max distance the ball will move per instrucicion in MoveTo function
192 #define MAX_NUMBERLEDS 100
193 //Disable interrupts during updating leds
194 //#define FASTLED_ALLOW_INTERRUPTS 0
195 
199 #define SPEED_MOTOR_DEFAULT 25
200 #define PLAYLIST_DEFAULT "/"
201 #define PALLETE_DEFAULT 1
202 #define PERIOD_LED_DEFAULT 10
203 #define ORDERMODE_DEFAULT 3
204 #define BLUETOOTHNAME "Sandsara"
205 
209 #define CEROZONE_PERFORMED 233
210 #define CEROZONE_NO_PERFORMED 177
211 
215 #define DELAYCOLORCODE 10
216 #define CODE_NOSD_PALLETE 71
217 #define CODE_UPDATING_PALLETE 72
218 #define CODE_CALIBRATING_PALLETE 73
219 #define CODE_SDEMPTY_PALLETE 74
220 
224 #define INCREMENTINDEXPALLETE 3
225 
229 #define SPI_SPEED_TO_SD SD_SCK_MHZ(16)
230 #define SD_CS_PIN 5
231 
235 #define NAME_LENGTH 60
236 
241 extern int EVERY_MILIMITERS;
242 extern int SPEED_TO_CENTER;
243 
247 #define BUFFER_BLUETOOTH 30000
248 
252 #define MAX_COLORSPERPALLETE 16
253 
257 #define MODE_CALIBRATION 1
258 #define MODE_PLAY 2
259 #define MODE_PAUSE 3
260 #define MODE_SLEEP 4
261 #define MODE_BUSY 5
262 
263 //App Variables
264 #define MIN_SLIDER_MSPEED 1
265 #define MAX_SLIDER_MSPEED 10
266 #define MIN_SLIDER_BRIGHTNESS 0
267 #define MAX_SLIDER_BRIGHTNESS 100
268 #define MIN_SLIDER_LEDSPEED 1
269 #define MAX_SLIDER_LEDSPEED 100
270 
271 #endif
double bigPulleySize
bigPulleySize y littlePulleySize se utilizan para saber la relacion de engranes bigPulleySize es la p...
Definition: Motors.cpp:11
int OUTOFTIME_BLUETOOTH_LINE
int CURRENT_IN_CALIBRATION
Definition: main.cpp:53
int MIN_SPEED_MOTOR
Definition: Bluetooth.cpp:18
int l1
l1 y l2 representan la longitud, en milimetros, de los eslabones 1 y 2, respectivamente.
Definition: Motors.cpp:8
int MIN_PALLETE
Definition: Bluetooth.cpp:24
int MAX_CHARACTER_PER_LINE
Definition: Motors.cpp:15
int EVERY_MILIMITERS
Parametros de ida al centro en espiral cada EVERY_MILIMITERS en modulo de recorrido dara una vuelta...
Definition: main.cpp:44
int MIN_REPRODUCTION_MODE
Definition: Bluetooth.cpp:28
int LEDS_OF_HALO
Definition: main.cpp:49
int NORMAL_CURRENT
Definition: main.cpp:52
int MAX_SPEED_MOTOR
Definition: Bluetooth.cpp:17
int SPEED_TO_CENTER
Definition: main.cpp:45
int MAX_PERIOD_LED
Definition: Bluetooth.cpp:20
double RESOLUCION_MAX
Definition: SdFiles.cpp:15
int MAX_REPRODUCTION_MODE
Definition: Bluetooth.cpp:29
char dataS[]
Definition: main.cpp:21
int MICROSTEPPING
Definition: WorkingArea.cpp:3
int MIN_PERIOD_LED
Definition: Bluetooth.cpp:21
int OUTOFTIME_BLUETOOTH
int MAX_POSITIONLIST
Definition: Bluetooth.cpp:31
double littlePulleySize
Definition: Motors.cpp:12
int MAX_CHARACTERS_BTNAME
Definition: Bluetooth.cpp:26
int l2
Definition: Motors.cpp:9
int MAX_STEPS_PER_SECOND
Definition: Motors.cpp:14
int MAX_PALLETE
Definition: Bluetooth.cpp:23
int MAX_CHARS_PLAYLIST
Restricciones.
Definition: main.cpp:47
double MAX_RADIO
DISTANCIA_MAX es el radio maximo, desde el centro, que va a dibujar el robot RESOLUCION_MAX es el num...
Definition: SdFiles.cpp:14
int LEDS_OF_STELLE
Definition: main.cpp:50