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

In "rec/robotino/api2/c/AnalogInput.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_ANALOGINPUTID   -1
 

Typedefs

typedef int AnalogInputId
 

Functions

DLLEXPORT AnalogInputId AnalogInput_construct (unsigned int n)
 
DLLEXPORT BOOL AnalogInput_destroy (AnalogInputId id)
 
DLLEXPORT BOOL AnalogInput_setComId (AnalogInputId id, ComId comId)
 
DLLEXPORT BOOL AnalogInput_setInputNumber (AnalogInputId id, unsigned int n)
 
DLLEXPORT unsigned int numAnalogInputs ()
 
DLLEXPORT float AnalogInput_value (AnalogInputId id)
 

Detailed Description

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

Use AnalogInput_construct() to create a new analog input object. Associate the bumper object with a com object using AnalogInput_setComId(). Use AnalogInput_value() to read the analog input's state.

Macro Definition Documentation

#define INVALID_ANALOGINPUTID   -1

Invalid AnalogInputId is -1

Typedef Documentation

typedef int AnalogInputId

AnalogInputId

Function Documentation

DLLEXPORT AnalogInputId AnalogInput_construct ( unsigned int  n)

Construct an analog input object

Returns
Returns the ID of the newly constructed analog input object.
Parameters
nThe input number. Range [0; numAnalogInputs()-1]
DLLEXPORT BOOL AnalogInput_destroy ( AnalogInputId  id)

Destroy the analog input object assigned to id

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

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

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

Sets the number of this analog input device.

Parameters
idThe id of the digital input object to be set
nThe input number. Range [0 - numAnalogInputs()]
Exceptions
ReturnsTRUE (1) on success otherwise FALSE (0)
DLLEXPORT float AnalogInput_value ( AnalogInputId  id)

Returns the current value of the specified input device.

Parameters
idThe id of the analog input object to be read
Returns
The current value of the specified analog input. Returns -1 if the given AnalogInputId is invalid or if this analog input is not connected to a valid com object.
DLLEXPORT unsigned int numAnalogInputs ( )
Returns
Returns the number of analog inputs.