mirror of
https://github.com/adrigongv23/G26---Telemetry-Software.git
synced 2026-08-25 11:33:17 +02:00
Todo subido
This commit is contained in:
parent
f0db3a8aeb
commit
27026caf57
87 changed files with 83292 additions and 17 deletions
48
Tiempo_por_vuelta/receptor_pruebas/skidpad.cpp
Normal file
48
Tiempo_por_vuelta/receptor_pruebas/skidpad.cpp
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#include <Arduino.h>
|
||||
|
||||
#include "skidpad.hpp"
|
||||
|
||||
static int ciclo = 0;
|
||||
|
||||
void reiniciar_receptor_skidpad() {
|
||||
ciclo = 0;
|
||||
}
|
||||
|
||||
void procesar_skidpad(const paquete_datos& datos) {
|
||||
switch (datos.estado) {
|
||||
case 1:
|
||||
ciclo = datos.vuelta;
|
||||
Serial.print("\n===== Ciclo ");
|
||||
Serial.print(ciclo);
|
||||
Serial.println(" =====");
|
||||
Serial.println("Primera activacion: nada");
|
||||
break;
|
||||
|
||||
case 2:
|
||||
Serial.println("Segunda activacion: inicia vuelta DERECHA");
|
||||
break;
|
||||
|
||||
case 3:
|
||||
Serial.print("Vuelta DERECHA terminada: ");
|
||||
Serial.print(datos.laptime_derecha / 1000.0, 3);
|
||||
Serial.println(" s");
|
||||
break;
|
||||
|
||||
case 4:
|
||||
Serial.println("Cuarta activacion: inicia vuelta IZQUIERDA");
|
||||
break;
|
||||
|
||||
case 5:
|
||||
Serial.print("Vuelta IZQUIERDA terminada: ");
|
||||
Serial.print(datos.laptime_izquierda / 1000.0, 3);
|
||||
Serial.println(" s");
|
||||
Serial.print("Media de ambas vueltas: ");
|
||||
Serial.print(datos.average / 1000.0, 3);
|
||||
Serial.println(" s");
|
||||
break;
|
||||
|
||||
default:
|
||||
Serial.println("Estado de Skidpad desconocido");
|
||||
break;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue