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

In "rec/robotino/api2/c/DigitalInput.h" you can find functions for reading Robotino's bumper. 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_DIGITALINPUTID   -1
 

Typedefs

typedef int DigitalInputId
 

Functions

DLLEXPORT DigitalInputId DigitalInput_construct (unsigned int n)
 
DLLEXPORT BOOL DigitalInput_destroy (DigitalInputId id)
 
DLLEXPORT BOOL DigitalInput_setComId (DigitalInputId id, ComId comId)
 
DLLEXPORT BOOL DigitalInput_setInputNumber (DigitalInputId id, unsigned int n)
 
DLLEXPORT unsigned int numDigitalInputs ()
 
DLLEXPORT BOOL DigitalInput_value (DigitalInputId id)
 

Detailed Description

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

Use DigitalInput_construct() to create a new Digital input object. Associate the bumper object with a com object using DigitalInput_setComId(). Use DigitalInput_value() to read the Digital input's state.

Macro Definition Documentation

#define INVALID_DIGITALINPUTID   -1

Invalid DigitalInputId is -1

Typedef Documentation

typedef int DigitalInputId

DigitalInputId

Function Documentation

DLLEXPORT DigitalInputId DigitalInput_construct ( unsigned int  n)

Construct an digital input object

Returns
Returns the ID of the newly constructed digital input object.
Parameters
nThe input number. Range [0; numDigitalInputs()-1]
DLLEXPORT BOOL DigitalInput_destroy ( DigitalInputId  id)

Destroy the Digital input object assigned to id

Parameters
idThe id of the digital input object to be destroyed
Returns
Returns TRUE (1) on success. Returns FALSE (0) if the given DigitalInputId is invalid.
DLLEXPORT BOOL DigitalInput_setComId ( DigitalInputId  id,
ComId  comId 
)

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

Returns
Returns TRUE (1) on success. Returns FALSE (0) if the given DigitalInputId or ComId is invalid.
DLLEXPORT BOOL DigitalInput_setInputNumber ( DigitalInputId  id,
unsigned int  n 
)

Sets the number of this digital input device.

Parameters
idThe id of the digital input object to be set
nThe input number. Range [0 - numDigitalInputs()]
Exceptions
RobotinoExceptionif the given input number is invalid.
DLLEXPORT BOOL DigitalInput_value ( DigitalInputId  id)

Returns the current value of the specified input device.

Parameters
idThe id of the digital input object to be read
Returns
The current value of the specified digital input
DLLEXPORT unsigned int numDigitalInputs ( )
Returns
Returns the number of digital inputs.