![]() |
Zap'Em Blast'Em Robots
robots that play laser tag!
|
: Main program body More...
#include "main.h"
#include "controller_task.h"
#include "motor_driver.h"
#include "game_task.h"
#include "sound_task.h"
#include "shoot_task.h"
#include "lcd.h"
#include "photoresistor_task.h"
#include "adc_task.h"
#include "encoder_driver.h"
#include "stm32f4xx_it.h"
#include <stdint.h>
Functions | |
void | calibration (void) |
This function runs at start to calibrate DC motors and photoresistors. | |
void | wait_for_stall (encoder_t *encoder) |
Waits until the encoder motion stalls (no significant ticks change). | |
void | SystemClock_Config (void) |
System Clock Configuration. | |
int | main (void) |
The application entry point. | |
void | HAL_GPIO_EXTI_Callback (uint16_t GPIO_Pin) |
void | Error_Handler (void) |
This function is executed in case of error occurrence. |
Variables | |
ADC_HandleTypeDef | hadc1 |
DMA_HandleTypeDef | hdma_adc1 |
I2C_HandleTypeDef | hi2c1 |
External handle to use your I2C peripheral. | |
TIM_HandleTypeDef | htim1 |
TIM_HandleTypeDef | htim2 |
TIM_HandleTypeDef | htim3 |
TIM_HandleTypeDef | htim4 |
TIM_HandleTypeDef | htim5 |
TIM_HandleTypeDef | htim9 |
uint8_t | red_held = 0 |
uint8_t | blue_held = 0 |
uint32_t | red_start = 0 |
uint32_t | blue_start = 0 |
uint32_t | red_elapsed = 0 |
uint32_t | blue_elapsed = 0 |
const uint32_t | hold_time = 2000 |
motor_t | mred |
motor_t | mblue |
encoder_t | red_encoder |
encoder_t | blue_encoder |
SoundTask | sound_task |
PhotoresistorTask | red_photoresistor_task |
PhotoresistorTask | blue_photoresistor_task |
GameTask | game_task |
ShootTask | red_shoot_task |
ShootTask | blue_shoot_task |
ControllerTask | blue_controller_task |
ControllerTask | red_controller_task |
ADCTask | adc_task |
: Main program body
Copyright (c) 2025 STMicroelectronics. All rights reserved.
This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.
void calibration | ( | void | ) |
This function runs at start to calibrate DC motors and photoresistors.
None |
void Error_Handler | ( | void | ) |
This function is executed in case of error occurrence.
None |
int main | ( | void | ) |
The application entry point.
int |
void SystemClock_Config | ( | void | ) |
System Clock Configuration.
None |
Configure the main internal regulator output voltage
Initializes the RCC Oscillators according to the specified parameters in the RCC_OscInitTypeDef structure.
Initializes the CPU, AHB and APB buses clocks
void wait_for_stall | ( | encoder_t * | p_enc | ) |
Waits until the encoder motion stalls (no significant ticks change).
p_enc | Pointer to encoder_t instance |
ADCTask adc_task |
ControllerTask blue_controller_task |
encoder_t blue_encoder |
PhotoresistorTask blue_photoresistor_task |
ShootTask blue_shoot_task |
GameTask game_task |
motor_t mblue |
motor_t mred |
ControllerTask red_controller_task |
encoder_t red_encoder |
PhotoresistorTask red_photoresistor_task |
ShootTask red_shoot_task |
SoundTask sound_task |