Formula Student Electronics & Software
The code for the embedded software
Loading...
Searching...
No Matches
integration_test.hpp File Reference
#include "Arduino.h"
Include dependency graph for integration_test.hpp:

Go to the source code of this file.

Macros

#define GREEN_LED_1   4
 
#define GREEN_LED_2   5
 
#define GREEN_LED_3   6
 
#define RED_LED_1   0
 
#define RED_LED_2   1
 
#define YELLOW_LED_1   2
 
#define YELLOW_LED_2   3
 
#define BUTTON_1   7
 
#define BUTTON_2   8
 
#define BUTTON_3   9
 
#define BUTTON_4   10
 
#define BUTTON_5   11
 
#define BUTTON_6   12
 
#define POTENCIO   14
 
#define BK_SENSOR_PIN   POTENCIO
 
#define R2D_PIN   BUTTON_1
 
#define TSON_PIN   BUTTON_2
 
#define AS_READY_PIN   BUTTON_3
 
#define STOP_PIN   BUTTON_4
 
#define STATE_IDLE_GREEN_LED_1_PIN   GREEN_LED_1
 
#define STATE_IDLE_GREEN_LED_2_PIN   GREEN_LED_2
 
#define STATE_IDLE_GREEN_LED_3_PIN   GREEN_LED_3
 
#define STATE_DRIVING_RED_LED_1_PIN   RED_LED_1
 
#define STATE_DRIVING_RED_LED_2_PIN   RED_LED_2
 
#define STATE_ASDRIVING_YELLOW_LED_1_PIN   YELLOW_LED_1
 
#define STATE_ASDRIVING_YELLOW_LED_2_PIN   YELLOW_LED_2
 

Functions

void brakeValueUpdate ()
 Integration test.
 
void updateTS ()
 
void updateASReady ()
 
void testing_setup ()
 
void state_light (int state)
 
void printVariables (int state)
 
void integrationtest (int R2DStatus)
 

Variables

volatile bool TSOn
 
volatile bool ASReady
 
volatile uint16_t brakeValue
 
elapsedMillis print_timer
 

Macro Definition Documentation

◆ AS_READY_PIN

#define AS_READY_PIN   BUTTON_3

Definition at line 23 of file integration_test.hpp.

◆ BK_SENSOR_PIN

#define BK_SENSOR_PIN   POTENCIO

Definition at line 20 of file integration_test.hpp.

◆ BUTTON_1

#define BUTTON_1   7

Definition at line 10 of file integration_test.hpp.

◆ BUTTON_2

#define BUTTON_2   8

Definition at line 11 of file integration_test.hpp.

◆ BUTTON_3

#define BUTTON_3   9

Definition at line 12 of file integration_test.hpp.

◆ BUTTON_4

#define BUTTON_4   10

Definition at line 13 of file integration_test.hpp.

◆ BUTTON_5

#define BUTTON_5   11

Definition at line 14 of file integration_test.hpp.

◆ BUTTON_6

#define BUTTON_6   12

Definition at line 15 of file integration_test.hpp.

◆ GREEN_LED_1

#define GREEN_LED_1   4

Definition at line 3 of file integration_test.hpp.

◆ GREEN_LED_2

#define GREEN_LED_2   5

Definition at line 4 of file integration_test.hpp.

◆ GREEN_LED_3

#define GREEN_LED_3   6

Definition at line 5 of file integration_test.hpp.

◆ POTENCIO

#define POTENCIO   14

Definition at line 16 of file integration_test.hpp.

◆ R2D_PIN

#define R2D_PIN   BUTTON_1

Definition at line 21 of file integration_test.hpp.

◆ RED_LED_1

#define RED_LED_1   0

Definition at line 6 of file integration_test.hpp.

◆ RED_LED_2

#define RED_LED_2   1

Definition at line 7 of file integration_test.hpp.

◆ STATE_ASDRIVING_YELLOW_LED_1_PIN

#define STATE_ASDRIVING_YELLOW_LED_1_PIN   YELLOW_LED_1

Definition at line 30 of file integration_test.hpp.

◆ STATE_ASDRIVING_YELLOW_LED_2_PIN

#define STATE_ASDRIVING_YELLOW_LED_2_PIN   YELLOW_LED_2

Definition at line 31 of file integration_test.hpp.

◆ STATE_DRIVING_RED_LED_1_PIN

#define STATE_DRIVING_RED_LED_1_PIN   RED_LED_1

Definition at line 28 of file integration_test.hpp.

◆ STATE_DRIVING_RED_LED_2_PIN

#define STATE_DRIVING_RED_LED_2_PIN   RED_LED_2

Definition at line 29 of file integration_test.hpp.

◆ STATE_IDLE_GREEN_LED_1_PIN

#define STATE_IDLE_GREEN_LED_1_PIN   GREEN_LED_1

Definition at line 25 of file integration_test.hpp.

◆ STATE_IDLE_GREEN_LED_2_PIN

#define STATE_IDLE_GREEN_LED_2_PIN   GREEN_LED_2

Definition at line 26 of file integration_test.hpp.

◆ STATE_IDLE_GREEN_LED_3_PIN

#define STATE_IDLE_GREEN_LED_3_PIN   GREEN_LED_3

Definition at line 27 of file integration_test.hpp.

◆ STOP_PIN

#define STOP_PIN   BUTTON_4

Definition at line 24 of file integration_test.hpp.

◆ TSON_PIN

#define TSON_PIN   BUTTON_2

Definition at line 22 of file integration_test.hpp.

◆ YELLOW_LED_1

#define YELLOW_LED_1   2

Definition at line 8 of file integration_test.hpp.

◆ YELLOW_LED_2

#define YELLOW_LED_2   3

Definition at line 9 of file integration_test.hpp.

Function Documentation

◆ brakeValueUpdate()

void brakeValueUpdate ( )

Integration test.

This should be used as integration testing together with the testing board. It simulates the behavior of:

  • Brake sensor
  • TSOn
  • ASReady
  • R2D It can be use to test the state machine logic. The LEDs represent the current state:
  • Green: Idle
  • Red: Driving
  • Yellow: ASDriving The serial monitor shows the current values of the variables.

Definition at line 57 of file integration_test.hpp.

Here is the caller graph for this function:

◆ integrationtest()

void integrationtest ( int  R2DStatus)

Definition at line 152 of file integration_test.hpp.

Here is the call graph for this function:

◆ printVariables()

void printVariables ( int  state)

Definition at line 131 of file integration_test.hpp.

Here is the caller graph for this function:

◆ state_light()

void state_light ( int  state)

Definition at line 95 of file integration_test.hpp.

Here is the caller graph for this function:

◆ testing_setup()

void testing_setup ( )

Definition at line 74 of file integration_test.hpp.

Here is the call graph for this function:

◆ updateASReady()

void updateASReady ( )

Definition at line 69 of file integration_test.hpp.

Here is the caller graph for this function:

◆ updateTS()

void updateTS ( )

Definition at line 64 of file integration_test.hpp.

Here is the caller graph for this function:

Variable Documentation

◆ ASReady

volatile bool ASReady
extern

Definition at line 22 of file main.cpp.

◆ brakeValue

volatile uint16_t brakeValue
extern

Definition at line 11 of file apps.cpp.

◆ print_timer

elapsedMillis print_timer

Definition at line 37 of file integration_test.hpp.

◆ TSOn

volatile bool TSOn
extern

Definition at line 19 of file main.cpp.