Overview | Main | State Machine | Events | IR | Tape | Drivetrain | PWM | Flash | Two Minute Timer | Bump

flashSensor.c
flashSensor.h

void initFlash(void): initialize the flash sensor

char getFlash(void): query the state of the flash sensor

void main(void): test harness for flash module

The flash module provides a simple interface to the flash sensor.

PSEUDOCODE

(Download Pseudocode .doc 26kb)

void initFlash(void)
    Set the data direction of the flash sensor pin to be an input

char getFlash(void)
    If the pin is high
        Return “flash is on”
    Else
        Return “flash is off”

void main(void) **Test Harness**
    Initialize the flash module
    Repeat forever
        Check for a flash
        Report a positive result