/* beacon.h * * This is the header file for all the beacon related routines. In particular, determination * of the center beacon and the currently active beacon are done in this file and beacon.c. */ #ifndef BEACON_H #define BEACON_H #define kSampleCount 50 // Number of beacon samples to measure #define kSampleRuns 10 // Number of times to sample the peak #define kMinStrength 150 // Range for center fixation // These correspond to the inputs on port E of the MicroCore: // change carefully! typedef enum { kCenterBeacon = 0, // Port E0 kRightBeacon, // Port E1 kLeftBeacon, // Port E2 kNumBeacons } BeaconCode; // Position of the center relative to current position typedef enum { kOrientationCentered, kOrientationSkewed, kOrientationUnknown } Orientation; // Exported routines void CollectPeakValues(unsigned int beaconSamples[], unsigned int numBeacons); BeaconCode FindActiveBeacon(BeaconCode lastBeacon); Orientation FindCenter(void); #endif // BEACON_H