#ifndef sniff_rvb_h #define sniff_rvb_h // sniff_rvb.h // es - Input/Output general purpose board. {{{ // // Copyright (C) 2006 Dufour Jérémy // // Robot APB Team/Efrei 2004. // Web: http://assos.efrei.fr/robot/ // Email: robot AT efrei DOT fr // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // }}} #include "io.h" #include "common.h" /** Analysis sensors and determine the colors. */ #define RVB_SNIFF_MAX_INDEX 4 #define RVB_SNIFF_GREEN 0 #define RVB_SNIFF_BLUE 1 #define RVB_SNIFF_RED 2 #define RVB_SNIFF_OTHER 3 #define RVB_SNIFF_BLACK 4 #define RVB_SNIFF_WHITE 5 /** Mode for color detection * ONLY_GREEN is faster but tells only if it's green or not **/ #define RVB_SNIFF_ONLY_GREEN 0 #define RVB_SNIFF_ALL_COLORS 1 /** Set the current color seen by some sensors as the reference color. * It must be called at the begining of the match for setting the green value. */ void sniff_rvb_set_ref_color (uint8_t sensor, uint8_t color); /** Analysis a color : * - sensor : the sensor number to analysis ; * - mode : for futur use. * return the color number. */ uint8_t sniff_rvb_analysis_color (uint8_t sensor, uint8_t mode); /* Test "barillet" black/white * - sensor : the sensor number to analysis ; */ uint8_t sniff_rvb_analysis_ball (uint8_t sensor); /** Configure the sensor analysis system. * - ref_ratio : ratio for the reference color. */ void sniff_rvb_config (uint8_t ref_ratio, uint16_t green_limit, uint16_t clear_limit); #endif // sniff_rvb_h