bom.c File Reference

Implementation for using the BOM. More...

#include "bom.h"
#include "dio.h"
#include "serial.h"
#include "analog.h"

Go to the source code of this file.

Defines

#define MONKI   PF0
#define MONKL   _PIN_E2
#define MONK1   _PIN_E3
#define MONK0   _PIN_E4
#define MONK3   _PIN_E6
#define MONK2   _PIN_E7
#define BOM_VALUE_THRESHOLD   150
#define NUM_BOM_LEDS   16
#define BOM_MODE   _PIN_E2
#define BOM_STROBE   _PIN_E3
#define BOM_DATA   _PIN_A0
#define BOM_CLOCK   _PIN_A1
#define BOM_S0   _PIN_E5
#define BOM_S1   _PIN_E4
#define BOM_S2   _PIN_E7
#define BOM_S3   _PIN_E6
#define BOM_OUT   PF0

Functions

void bom_init (char type)
 Initialize the bom according to bom type.
void bom_refresh (int bit_field)
 Refresh bom_val[] with new values from analog8. analog_init and bom_init must be called for this to work.
int bom_get (int which)
 Gets the bom reading from bom_val[which]. Call bom_refresh beforehand to read new bom values.
int bom_get_max (void)
 Compares all the values in bom_val[] and returns the index to the highest value element.
int bom_get_vector (Vector *, int *)
 Computes the net resultant BOM IR vector.
int bom_get_norm_vector (Vector *, int *)
 Computes the normalized net resultant BOM IR vector.
int bom_print_usb (int *)
 Print snapshot of BOM intensity histogram over USB connection.
int bom_get_max10 (int *dist)
 Computes the weighted average of all the bom readings to estimate the position and distance of another robot.
void bom_set_leds (int bit_field)
 Enables the selected bom leds on a BOM1.5.
int get_max_bom (void)
 (DEPRECATED) Gets and compares all bom values. Returns the index to the highest value element since last refresh.
void bom_on (void)
 Turns on all BOM leds, or turns on enabled leds on a BOM1.5.
void bom_off (void)
 Turns off all bom leds.

Detailed Description

Implementation for using the BOM.

Copyright (c) 2007 Colony Project

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contains functions for using the Bearing and Orientation Module (BOM)

Author:
Colony Project, CMU Robotics Club

Definition in file bom.c.


Generated on Thu May 17 00:00:09 2012 for libdragonfly by  doxygen 1.6.1