This project is an AVR microcontroller-based fan speed controller that adjusts the fan speed based on the temperature readings from a temperature sensor.
include/fan_controller.h
: Header file for the fan controller functions.include/temperature_sensor.h
: Header file for the temperature sensor functions.src/fan_controller.c
: Source file for the fan controller implementation.src/temperature_sensor.c
: Source file for the temperature sensor implementation.src/main.c
: Main application source file.Makefile
: Makefile for building the project.
void fan_controller_init(void)
: Initializes the fan controller.void fan_controller_set_speed(uint16_t temperature)
: Sets the fan speed based on the temperature.
void temperature_sensor_init(void)
: Initializes the temperature sensor.uint16_t temperature_sensor_read(void)
: Reads the temperature from the sensor.
To build the project, run the following command:
make
This will generate the fan_speed_controller.hex file.
To flash the firmware to the microcontroller, run the following command:
make flash
- Ensure that the microcontroller is connected to /dev/ttyUSB0.
To clean the build files, run the following command:
make clean