Open Sint  3.4-2
Functions | Variables
anemometer.c File Reference

These routines are used to read the wind speed and direction, do media etc. More...

#include <stdlib.h>
#include <inttypes.h>
#include <avr/eeprom.h>
#include "anemometer.h"
Include dependency graph for anemometer.c:

Functions

uint8_t anemometer_adjust (struct wind_array *wind)
 apply correction to wind value if needed. More...
 
void anemometer_start (struct wind_array *wind)
 enable the anemometer and start storing value.
 
void anemometer_stop (struct wind_array *wind)
 disable the anemometer.
 
void array_init (struct wind_array *wind)
 initialize the wind struct
 
uint8_t anemometer_eeread (void)
 Read which wind sensor is stored into the EEPROM.
 
void anemometer_eesave (uint8_t sensor)
 
void anemometer_init (void)
 initialize the anemometer. allocate the memory for the wind struct, read from eeprom which wind sensor to use and, in case of auto wind sensor, try to locate which one. More...
 
enum wind_dir get_wind_direction (int direction)
 return standard direction from encoder. More...
 

Variables

uint8_t EEMEM EE_sensor
 

Detailed Description

These routines are used to read the wind speed and direction, do media etc.

Function Documentation

◆ anemometer_adjust()

uint8_t anemometer_adjust ( struct wind_array wind)

apply correction to wind value if needed.

Returns
1 - data is valid, 0 - wrong data.

◆ anemometer_init()

void anemometer_init ( void  )

initialize the anemometer. allocate the memory for the wind struct, read from eeprom which wind sensor to use and, in case of auto wind sensor, try to locate which one.

Returns
allocated wind structure.
Note
the wind struct is global, no need to pass it.

◆ get_wind_direction()

enum wind_dir get_wind_direction ( int  direction)

return standard direction from encoder.

Parameters
directiondegrees wind direction to convert (0-359).
Returns
converted value.

Variable Documentation

◆ EE_sensor

uint8_t EEMEM EE_sensor

type of wind sensor (GLOBAL)