primer test shield
This commit is contained in:
36
README.md
36
README.md
@@ -12,20 +12,20 @@ Para controlar los motores del carro usamos un driver TB6612FNG, el cual es un m
|
||||
|
||||
### TB6612FNG
|
||||
|
||||
PWMA --> GPIO36 --> 5
|
||||
AI2 --> GPIO39 --> 8
|
||||
AI1 --> GPIO34 --> 10
|
||||
STBY --> GPIO35 --> 11
|
||||
BI1 --> GPIO32 --> 12
|
||||
BI2 --> GPIO33 --> 13
|
||||
PWMA --> GPIO33
|
||||
AIN1 --> GPIO26
|
||||
AIN2 --> GPIO25
|
||||
BIN1 --> GPIO27
|
||||
BIN2 --> GPIO14
|
||||
PWMA --> GPIO13
|
||||
|
||||
### Sensor TCRT5000
|
||||
|
||||
OUT1 --> GPIO15 --> ADC2_3 --> A13
|
||||
OUT2 --> GPIO14 --> ADC2_2 --> A16
|
||||
OUT3 --> GPIO12 --> ADC2_1 --> A15
|
||||
OUT4 --> GPIO4 --> ADC2_0 --> A10
|
||||
OUT5 --> GPIO13 --> ADC2_4 --> A14
|
||||
OUT1 --> GPIO36 --> ADC1_0
|
||||
OUT2 --> GPIO39 --> ADC1_3
|
||||
OUT3 --> GPIO34 --> ADC1_6
|
||||
OUT4 --> GPIO35 --> ADC1_7
|
||||
OUT5 --> GPIO32 --> ADC1_4
|
||||
|
||||
|
||||
---
|
||||
@@ -37,13 +37,13 @@ Alimentación:
|
||||
---
|
||||
|
||||
# ToDo
|
||||
[] Shield diseño esquemático
|
||||
[] PCB
|
||||
[] Fabricación Shield
|
||||
[] Ensamble Shield
|
||||
[] Pruebas
|
||||
[] Seguidor de linea
|
||||
[] no choque
|
||||
[x] Shield diseño esquemático
|
||||
[x] PCB
|
||||
[x] Fabricación Shield
|
||||
[x] Ensamble Shield
|
||||
[] Pruebas
|
||||
[] Seguidor de linea
|
||||
[] no choque
|
||||
|
||||
## Referencias
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ void printSensores()
|
||||
}
|
||||
|
||||
void init_sensores(){
|
||||
analogSetAttenuation(ADC_0db);
|
||||
pinMode(OUT1, INPUT);
|
||||
pinMode(OUT2, INPUT);
|
||||
pinMode(OUT3, INPUT);
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
TaskHandle_t TareaProcesador1;
|
||||
TaskHandle_t TareaProcesador2;
|
||||
void loop1(void *pvParameters);
|
||||
void loop2(void *pvParameters);
|
||||
int anterior = millis();
|
||||
char sensorCadena[16];
|
||||
|
||||
@@ -29,7 +28,6 @@ void setup()
|
||||
webSocket.onEvent(webSocketEvent);
|
||||
server.begin();
|
||||
xTaskCreatePinnedToCore(loop1, "Tarea1", 10000, NULL, 1, &TareaProcesador1, 0);
|
||||
xTaskCreatePinnedToCore(loop2, "Tarea2", 10000, NULL, 1, &TareaProcesador2, 1);
|
||||
delay(200);
|
||||
|
||||
Serial.println("Carro Esp32");
|
||||
@@ -44,7 +42,15 @@ void setup()
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (((millis() - anterior) > 100) && (nCliente > -1))
|
||||
{
|
||||
anterior = millis();
|
||||
|
||||
sprintf(sensorCadena, "%d",readSensors(0));
|
||||
webSocket.sendTXT(nCliente, sensorCadena);
|
||||
}
|
||||
}
|
||||
|
||||
void loop1(void *pvParameters)
|
||||
{
|
||||
for (;;)
|
||||
@@ -56,17 +62,3 @@ void loop1(void *pvParameters)
|
||||
}
|
||||
}
|
||||
|
||||
void loop2(void *pvParameters)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
|
||||
if (((millis() - anterior) > 100) && (nCliente > -1))
|
||||
{
|
||||
anterior = millis();
|
||||
|
||||
sprintf(sensorCadena, "%d",readSensors(0));
|
||||
webSocket.sendTXT(nCliente, sensorCadena);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user