data.c File Reference

#include <stdlib.h>
#include <avr/io.h>
#include "adc.h"
#include "data.h"
#include "lcd.h"
#include "motorcontroller.h"

Defines

#define SIZE   100

Functions

void storePeriodLength (unsigned int value)
 Store length of the period.
void determineFrequency (void)
 Calculate the average periodlength in seconds.
void printToLCD (int frequency, int periods)
 Print frequency and number of periods to LCD.
void inc_nrOfPeriods (void)
 Increase number of periods.
void dec_nrOfPeriods (void)
 Decrease number of periods.
int getNrOfPeriods (void)
 Get number of periods.
int getFrequency (void)
 Returns frequency.

Variables

int maxPeriods = 6
int nextIndex = 0
unsigned int timerValues [SIZE]
double frequency = 0
const double periodLength = 8/16000000.0
const double SSE_PCT = SETPOINT*0.005

Define Documentation

#define SIZE   100


Function Documentation

void dec_nrOfPeriods ( void   ) 

Decrease number of periods.

void determineFrequency ( void   ) 

Calculate the average periodlength in seconds.

int getFrequency ( void   ) 

Returns frequency.

Returns:
Frequency as an integer

int getNrOfPeriods ( void   ) 

Get number of periods.

Returns:
Number of periods

void inc_nrOfPeriods ( void   ) 

Increase number of periods.

void printToLCD ( int  frequency,
int  periods 
)

Print frequency and number of periods to LCD.

Parameters:
frequency Frequency in Hertz
periods Number of periods

void storePeriodLength ( unsigned int  value  ) 

Store length of the period.

Parameters:
value time in microseconds


Variable Documentation

double frequency = 0

int maxPeriods = 6

int nextIndex = 0

const double periodLength = 8/16000000.0

const double SSE_PCT = SETPOINT*0.005

unsigned int timerValues[SIZE]


Generated on Sat Jun 9 13:19:03 2007 for Automatisk Guitartuner by  doxygen 1.5.2