Malawi Production Quality
 All Files Functions Variables Macros Pages
Macros | Variables
Malawi_001.ino File Reference
#include "Arduino.h"
#include <SD.h>
Include dependency graph for Malawi_001.ino:

Go to the source code of this file.

Macros

#define FIELD_SEPARATOR   ";"
 
#define LED   6
 
#define CS   10
 
#define INTERRUPT_INPUT   2
 
#define BUFFER_ENTRIES   50
 
#define FLASH_OVERRUN   150
 
#define FLASH_CARD   2000
 
#define FLASH_100   1000
 
#define NO_CARD   1
 
#define OVERRUN   2
 
#define FILE100   3
 

Functions

flash(unsigned long flashTime)
Parameters
flashTimesets the time the LED is on and off flashes the Led
void flash (unsigned long flashTime)
 
HandleEdgeChange()

This is the Interrupt Service Routine called every time the pulse edge changes

void HandleEdgeChange ()
 
writeBuffer(uint8_t index)
Parameters
indexpointer to writable buffer Writes a buffer of integer values to the file
void writeBuffer (uint8_t index)
 
setup()

initialize the program

void setup ()
 
loop()

main loop of program and runs endlessly

void loop ()
 

Variables

char fileName [13]
 
char fileType [] = ".csv"
 
char fileNameStart [] = "MALAWI"
 
File dataFile
 
volatile bool firstValue = true
 
volatile unsigned long oldValue
 
volatile unsigned long currentValue
 
volatile int buffer [2][BUFFER_ENTRIES]
 
volatile int * ptrBuffer
 
volatile uint8_t bufferIndex
 
volatile unsigned int entryIndex
 
volatile boolean bufferFull
 
volatile unsigned int error = 0
 

Detailed Description

Author
Nico Verduin
Date
30-12-2013

Definition in file Malawi_001.ino.

Macro Definition Documentation

#define BUFFER_ENTRIES   50

Definition at line 91 of file Malawi_001.ino.

Referenced by HandleEdgeChange(), and writeBuffer().

#define CS   10

Definition at line 86 of file Malawi_001.ino.

Referenced by setup().

#define FIELD_SEPARATOR   ";"

Definition at line 81 of file Malawi_001.ino.

Referenced by writeBuffer().

#define FILE100   3

Definition at line 97 of file Malawi_001.ino.

Referenced by loop(), and setup().

#define FLASH_100   1000

Definition at line 94 of file Malawi_001.ino.

Referenced by loop().

#define FLASH_CARD   2000

Definition at line 93 of file Malawi_001.ino.

Referenced by loop().

#define FLASH_OVERRUN   150

Definition at line 92 of file Malawi_001.ino.

Referenced by loop().

#define INTERRUPT_INPUT   2

Definition at line 87 of file Malawi_001.ino.

Referenced by HandleEdgeChange().

#define LED   6

Definition at line 85 of file Malawi_001.ino.

Referenced by flash(), loop(), and setup().

#define NO_CARD   1

Definition at line 95 of file Malawi_001.ino.

Referenced by loop(), and setup().

#define OVERRUN   2

Definition at line 96 of file Malawi_001.ino.

Referenced by HandleEdgeChange(), and loop().

Function Documentation

void flash ( unsigned long  flashTime)

Definition at line 114 of file Malawi_001.ino.

References LED.

Referenced by loop().

Here is the caller graph for this function:

void HandleEdgeChange ( )

Definition at line 126 of file Malawi_001.ino.

References buffer, BUFFER_ENTRIES, bufferFull, bufferIndex, currentValue, entryIndex, error, firstValue, INTERRUPT_INPUT, oldValue, OVERRUN, and ptrBuffer.

Referenced by setup().

Here is the caller graph for this function:

void loop ( )

Definition at line 308 of file Malawi_001.ino.

References bufferFull, bufferIndex, error, FILE100, flash(), FLASH_100, FLASH_CARD, FLASH_OVERRUN, LED, NO_CARD, OVERRUN, and writeBuffer().

Here is the call graph for this function:

void setup ( )

Definition at line 209 of file Malawi_001.ino.

References buffer, bufferFull, bufferIndex, CS, dataFile, entryIndex, error, FILE100, fileName, fileNameStart, fileType, HandleEdgeChange(), LED, NO_CARD, and ptrBuffer.

Here is the call graph for this function:

void writeBuffer ( uint8_t  index)

Definition at line 182 of file Malawi_001.ino.

References buffer, BUFFER_ENTRIES, dataFile, and FIELD_SEPARATOR.

Referenced by loop().

Here is the caller graph for this function:

Variable Documentation

volatile int buffer[2][BUFFER_ENTRIES]

Definition at line 102 of file Malawi_001.ino.

Referenced by HandleEdgeChange(), setup(), and writeBuffer().

volatile boolean bufferFull

Definition at line 106 of file Malawi_001.ino.

Referenced by HandleEdgeChange(), loop(), and setup().

volatile uint8_t bufferIndex

Definition at line 104 of file Malawi_001.ino.

Referenced by HandleEdgeChange(), loop(), and setup().

volatile unsigned long currentValue

Definition at line 101 of file Malawi_001.ino.

Referenced by HandleEdgeChange().

File dataFile

Definition at line 78 of file Malawi_001.ino.

Referenced by setup(), and writeBuffer().

volatile unsigned int entryIndex

Definition at line 105 of file Malawi_001.ino.

Referenced by HandleEdgeChange(), and setup().

volatile unsigned int error = 0

Definition at line 107 of file Malawi_001.ino.

Referenced by HandleEdgeChange(), loop(), and setup().

char fileName[13]

Definition at line 75 of file Malawi_001.ino.

Referenced by setup().

char fileNameStart[] = "MALAWI"

Definition at line 77 of file Malawi_001.ino.

Referenced by setup().

char fileType[] = ".csv"

Definition at line 76 of file Malawi_001.ino.

Referenced by setup().

volatile bool firstValue = true

Definition at line 99 of file Malawi_001.ino.

Referenced by HandleEdgeChange().

volatile unsigned long oldValue

Definition at line 100 of file Malawi_001.ino.

Referenced by HandleEdgeChange().

volatile int* ptrBuffer

Definition at line 103 of file Malawi_001.ino.

Referenced by HandleEdgeChange(), and setup().