Obstacle sensor Library 1.0.0
This is a library for the Obstacle sensor Module
Loading...
Searching...
No Matches
Obstacle_Sensor Class Reference

#include <Obstacle-Sensor-SOLDERED.h>

Inherits EasyC.

Public Member Functions

bool digitalRead ()
 Sensor specific native constructor.
 
uint16_t analogRead ()
 Returns analog value of sensor.
 
void setTreshold (uint16_t value)
 Sets treshold for turning on integrated L0 LED on breakout.
 
uint16_t getTreshold (void)
 Sets treshold for turning on integrated L0 LED on breakout.
 
bool available ()
 Function which checks if I2C device is responding.
 
- Public Member Functions inherited from EasyC
 EasyC ()
 Main constructor for easyC version.
 
void begin ()
 Initializes sensors on native or easyC on default address.
 
void begin (uint8_t _address)
 Initializes sensors on supplied i2c address.
 
int sendAddress (char regAddr)
 Private function to send a single byte to sensor.
 
int readData (char a[], int n)
 Private function to read n bytes over i2c.
 
int readRegister (char regAddr, char a[], size_t n)
 Private function to send over i2c and then read n bytes.
 
int sendData (const uint8_t *a, int n)
 Private function to write n bytes over i2c.
 

Protected Member Functions

void initializeNative ()
 

Private Attributes

int pin
 
uint16_t val
 
uint16_t treshold = 127
 

Additional Inherited Members

- Public Attributes inherited from EasyC
int native = 0
 
bool beginDone = 0
 
int err
 
char address
 
const char defaultAddress = 0x30
 

Member Function Documentation

◆ analogRead()

uint16_t Obstacle_Sensor::analogRead ( )

Returns analog value of sensor.

Returns
int Analog value of sensor.

◆ available()

bool Obstacle_Sensor::available ( )

Function which checks if I2C device is responding.

Returns
1 if device is responding, 0 if not

◆ digitalRead()

bool Obstacle_Sensor::digitalRead ( )

Sensor specific native constructor.

Parameters
int_pin Example parameter.

Overloaded function for virtual in base class to initialize sensor specific.

Returns digital value of sensor.

Returns
bool Digital value of sensor.

◆ getTreshold()

uint16_t Obstacle_Sensor::getTreshold ( void )

Sets treshold for turning on integrated L0 LED on breakout.

◆ initializeNative()

void Obstacle_Sensor::initializeNative ( )
inlineprotectedvirtual

Implements EasyC.

◆ setTreshold()

void Obstacle_Sensor::setTreshold ( uint16_t value)

Sets treshold for turning on integrated L0 LED on breakout.

Member Data Documentation

◆ pin

int Obstacle_Sensor::pin
private

◆ treshold

uint16_t Obstacle_Sensor::treshold = 127
private

◆ val

uint16_t Obstacle_Sensor::val
private

The documentation for this class was generated from the following files: