Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: rohm-SensorShield-example
BH1749NUC Class Reference
Interface for controlling BME280 Combined humidity and pressure sensor. More...
#include <BH1749NUC.h>
Public Member Functions | |
| BH1749NUC (PinName sda, PinName scl, int addr=BH1749NUC_DEVICE_ADDRESS_39) | |
| Create a BH1749NUC instance which is connected to specified I2C pins with specified address. | |
| ~BH1749NUC () | |
| BH1749NUC destructor. | |
| int | init (void) |
| Initialize BH1749NUC device. | |
| int | get_rawval (char *data) |
| Get color sensor raw value. | |
| int | get_val (unsigned short *data) |
| Get color sensor value. | |
Detailed Description
Interface for controlling BME280 Combined humidity and pressure sensor.
#include "mbed.h" #include "BH1749NUC.h" BH1749NUC color(I2C_SDA, I2C_SCL); int main(void) { uint16_t buf[5]; color.init(); while (1) { color.get_val(buf); printf("BH1749 color : [R] %04x, [G] %04x, [B] %04x, [IR] %04x, [G2] %04x\n", buf[0], buf[1], buf[2], buf[3], buf[4]); wait(1); } }
BH1749NUC class
BH1749NUC: A library to correct color data using Rohm BH1749NUC color sensor device
Definition at line 87 of file BH1749NUC.h.
Constructor & Destructor Documentation
| BH1749NUC | ( | PinName | sda, |
| PinName | scl, | ||
| int | addr = BH1749NUC_DEVICE_ADDRESS_39 |
||
| ) |
Create a BH1749NUC instance which is connected to specified I2C pins with specified address.
- Parameters:
-
sda I2C-bus SDA pin sdl I2C-bus SCL pin addr slave address of the I2C peripheral (default: 0x72)
Definition at line 27 of file BH1749NUC.cpp.
| ~BH1749NUC | ( | ) |
BH1749NUC destructor.
Definition at line 31 of file BH1749NUC.cpp.
Member Function Documentation
| int get_rawval | ( | char * | data ) |
Get color sensor raw value.
- Parameters:
-
data buffer to store raw data
Definition at line 84 of file BH1749NUC.cpp.
| int get_val | ( | unsigned short * | data ) |
Get color sensor value.
- Parameters:
-
data buffer to store sensor data (R, B, G, IR and G2)
Definition at line 96 of file BH1749NUC.cpp.
| int init | ( | void | ) |
Initialize BH1749NUC device.
Definition at line 36 of file BH1749NUC.cpp.
Generated on Wed Jul 13 2022 22:24:55 by
1.7.2