Camduino
Camduino is an interface to speak with Arduino over I2C.
 All Data Structures Files Functions Variables Enumerations Enumerator Macros
Functions
camduino.c File Reference
#include "camduino.h"
#include "nxt_avr.h"

Functions

void init_camduino (int i2c_port)
 
void get_ball_position (struct position *ball)
 
int object_detected ()
 
int get_pstate (enum psensor sensor)
 

Detailed Description

File description

Librairy to get some data from an Arduino over I2C. CMUcam4 must be connect on it and Arduino must run "CMU_Tracker_I2C" program, distance sensors must be connected to the board too.

Copyright

Trampoline is copyright (c) IRCCyN 2005-2014 Trampoline is protected by the French intellectual property law.

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; version 2 of the License.

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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

File informations

Date
2014/07/21
Author
Benjamin Sientzoff
Version
0.1

Function Documentation

void get_ball_position ( struct position ball)

Fill a position strucuture to get ball position

Parameters
[in]ballA reference to the struct to fill
int get_pstate ( enum psensor  sensor)

Get an given presence sensor state

Parameters
[in]sensorName of the presence sensor to examine
[out]intstate of the sensor, return 0 if no detected object, else 1
void init_camduino ( int  i2c_port)

Initiate Arduino driver, don't forget to call i2c_init() after. Set up i2c port, tram communication and power supply.

Parameters
[in]i2c_portNXT port where Arduino is connected
int object_detected ( )

Get global presence sensors state

Parameters
[out]intState of the presence sensors, equals to NO_DETECTED_OBJECT if an object is not detected, else return a different value