BH1749 Class
Item Index
Methods
- BH1749
- Enable
- Disable
- CheckWhoAmI
- SensorInit
- SetOperatingMode
- GetOperatingMode
- SetMeasurementTime
- GetMeasurementTime
- SetRgbGain
- GetRgbGain
- SetIrGain
- GetIrGain
- SetIntSource
- GetInterruptSourceChar
- EnableInterrupt
- DisableInterrupt
- ResetInterrupt
- IsInterrupted
- IsInterruptEnabled
- SoftReset
- SetThresholdHigh
- GetThresholdHigh
- SetThresholdLow
- GetThresholdLow
- GetRed
- GetGreen
- GetBlue
- GetIr
- GetGeen2
- GetMeasurements
- InstallISR
- RemoveISR
- RegistersDump
Methods
BH1749
-
bus
-
addr
This calls SensorInit() to set default values for operating mode, gains, measurement time, interrupt source and then sets threshold high to 511.
Parameters:
-
bus
NumberI2C bus number
-
addr
NumberI2C sensor address
Returns:
Enable
()
Disable
()
CheckWhoAmI
()
SensorInit
-
opMode
-
measTime
-
rgbGain
-
irGain
-
intSource
Parameters:
-
opMode
OPERATING_MODESOperating mode choice, a value of OPERATING_MODES enum
-
measTime
MEAS_TIMESMeasurement time choice, a value of MEAS_TIMES enum
-
rgbGain
RGB_GAINSRGB gain choice, a value of RGB_GAINS enum
-
irGain
IR_GAINSIR gain choice, a value of IR_GAINS enum
-
intSource
INT_SOURCESinterrupt source choice, a value of INT_SOURCES enum
SetOperatingMode
-
opMode
Parameters:
-
opMode
OPERATING_MODESOperating mode choice, a value of OPERATING_MODES enum
GetOperatingMode
()
Number
Returns:
operating mode value
SetMeasurementTime
-
measTime
Parameters:
-
measTime
MEAS_TIMESmeasurement time choice, a value of MEAS_TIMES enum
GetMeasurementTime
()
Number
Returns:
measurement time value
SetRgbGain
-
rgbGain
Parameters:
-
rgbGain
RGB_GAINSRGB gain choice, a value of RGB_GAINS enum
GetRgbGain
()
Number
Returns:
RGB gain value value
SetIrGain
-
irGain
Parameters:
-
irGain
IR_GAINSIR gain choice, a value of IR_GAINS enum
GetIrGain
()
Number
Returns:
IR gain value value
SetIntSource
-
intSource
Parameters:
-
intSource
INT_SOURCESinterrupt source choice, a value of INT_SOURCES enum
GetInterruptSourceChar
()
String
Returns:
interrupt source value
EnableInterrupt
()
DisableInterrupt
()
ResetInterrupt
()
IsInterrupted
()
Boolean
Returns:
true if interrupt is raised, otherwise false
IsInterruptEnabled
()
Boolean
Returns:
true if interrupt is enabled, otherwise false
SoftReset
()
SetThresholdHigh
-
threshold
Parameters:
-
threshold
Numberinterrupt threshold high value, range 0-65536
GetThresholdHigh
()
Number
Returns:
threshold high value
SetThresholdLow
-
threshold
Parameters:
-
threshold
Numberinterrupt threshold low value, range 0-65536
GetThresholdLow
()
Number
Returns:
threshold low value
GetRed
()
Number
Returns:
red channel value
GetGreen
()
Number
Returns:
green channel value
GetBlue
()
Number
Returns:
blue channel value
GetIr
()
Number
Returns:
ir channel value
GetGeen2
()
Number
Returns:
green2 channel value
GetMeasurements
()
Std::vector uint16_t
Returns:
vector with all channels values ordered as: Red, Green, Blue, IR, Green2
InstallISR
-
edge
-
pin
-
isr
-
isr_args
Parameters:
-
edge
Mraa_gpio_edge_tEdge type to raise ISR with, of type mraa_gpio_edge_t
-
pin
NumberGPIO pin number
-
isr
FunctionPointer to ISR function
-
isr_args
Void *Arguments to pass the ISR function
RemoveISR
()
RegistersDump
()
String
Returns:
string of dumped registers