rec::robotino::api2 C interface
Macros | Typedefs | Functions
Gyroscope.h File Reference

In "rec/robotino/api2/c/Gyroscope.h" you can find functions for reading Robotino's Gyroscope. More...

#include "rec/robotino/api2/c/globals.h"
#include "rec/robotino/api2/c/Com.h"

Go to the source code of this file.

Macros

#define INVALID_GyroscopeID   -1
 

Typedefs

typedef int GyroscopeId
 

Functions

DLLEXPORT GyroscopeId Gyroscope_construct ()
 
DLLEXPORT BOOL Gyroscope_destroy (GyroscopeId id)
 
DLLEXPORT BOOL Gyroscope_setComId (GyroscopeId id, ComId comId)
 
DLLEXPORT float Gyroscope_angle (GyroscopeId id)
 
DLLEXPORT float Gyroscope_rate (GyroscopeId id)
 
DLLEXPORT int Gyroscope_num_objects (void)
 

Detailed Description

In "rec/robotino/api2/c/Gyroscope.h" you can find functions for reading Robotino's Gyroscope.

Use Gyroscope_construct() to create a new Gyroscope object. Associate the Gyroscope object with a com object using Gyroscope_setComId(). Use Gyroscope_value() to read the Gyroscope's state.

Macro Definition Documentation

#define INVALID_GyroscopeID   -1

Invalid GyroscopeId is -1

Typedef Documentation

typedef int GyroscopeId

GyroscopeId

Function Documentation

DLLEXPORT float Gyroscope_angle ( GyroscopeId  id)

Get the current angle in radians of the Gyroscope.

Parameters
idThe Gyroscope id.
Returns
Returns TRUE (1) if the Gyroscope is pressed. Returns FALSE (0) otherwise.
DLLEXPORT GyroscopeId Gyroscope_construct ( )

Construct an Gyroscope object

Returns
Returns the ID of the newly constructed Gyroscope object.
DLLEXPORT BOOL Gyroscope_destroy ( GyroscopeId  id)

Destroy the Gyroscope object assigned to id

Parameters
idThe id of the Gyroscope object to be destroyed
Returns
Returns TRUE (1) on success. Returns FALSE (0) if the given GyroscopeId is invalid.
DLLEXPORT float Gyroscope_rate ( GyroscopeId  id)

Get the current rate in radians/seconds of the Gyroscope.

Parameters
idThe Gyroscope id.
Returns
Returns TRUE (1) if the Gyroscope is pressed. Returns FALSE (0) otherwise.
DLLEXPORT BOOL Gyroscope_setComId ( GyroscopeId  id,
ComId  comId 
)

Associated a Gyroscope object with a communication interface, i.e. binding the Gyroscope to a specific Robotino

Returns
Returns TRUE (1) on success. Returns FALSE (0) if the given GyroscopeId or ComId is invalid.