#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 SIZE 100 |
void dec_nrOfPeriods | ( | void | ) |
Decrease number of periods.
void determineFrequency | ( | void | ) |
Calculate the average periodlength in seconds.
int getFrequency | ( | void | ) |
Returns frequency.
int getNrOfPeriods | ( | void | ) |
Get 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.
frequency | Frequency in Hertz | |
periods | Number of periods |
void storePeriodLength | ( | unsigned int | value | ) |
Store length of the period.
value | time in microseconds |
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] |