Skip to content

Instantly share code, notes, and snippets.

View RyanMorgan's full-sized avatar

Ryan Morgan RyanMorgan

  • Washington, D.C.
View GitHub Profile
// RGB sensor code, stripped to basics, to get initialization working...
const i2c_ioexp = 0x7C; // I2C channel base adddreses
const i2c_als = 0xE8; // adjusted to 8 bit values
// Initialise the imp hardware
local i2c = hardware.i2c89;
i2c.configure(CLOCK_SPEED_100_KHZ);
// ------------------------------------------------ rgbdcs register definitions -----------------------------------------------------
const rgbdcsRED = 0; const rgbdcsGREEN = 1; const rgbdcsBLUE = 2; const rgbdcsCLEAR = 3;
// RGB sensor code, stripped to basics, to get initialization working...
const i2c_ioexp = 0x7C; // I2C channel base adddreses
const i2c_als = 0xE8; // adjusted to 8 bit values
// Initialise the imp hardware
local i2c = hardware.i2c89;
i2c.configure(CLOCK_SPEED_100_KHZ);
// ------------------------------------------------ rgbdcs register definitions -----------------------------------------------------
const rgbdcsRED = 0; const rgbdcsGREEN = 1; const rgbdcsBLUE = 2; const rgbdcsCLEAR = 3;