Things used in this project

Hardware components:
Calliope mini weiss joernalraun ixmjbewlqx
Calliope mini v1.0
×1
sparkfun isl29125 RGB Sensor
×1

Code

ISL29125 RGB Sensor JavaScript
let blue = 0
let green = 0
let red = 0
basic.forever(() => {
    serial.writeString("[")
    // read register 0x0c (RED)
    pins.i2cWriteNumber(68, 12, NumberFormat.UInt8BE)
    red = pins.i2cReadNumber(68, NumberFormat.UInt8BE)
    serial.writeNumber(red)
    serial.writeString(",")
    // read register 0x0a (GREEN)
    pins.i2cWriteNumber(68, 10, NumberFormat.Int8BE)
    green = pins.i2cReadNumber(68, NumberFormat.UInt8BE)
    serial.writeNumber(green)
    serial.writeString(",")
    // read register 0x0e (BLUE)
    pins.i2cWriteNumber(68, 14, NumberFormat.UInt8BE)
    blue = pins.i2cReadNumber(68, NumberFormat.UInt8BE)
    serial.writeNumber(blue)
    serial.writeLine("]")
    basic.setLedColor(basic.rgbw(
        red,
        green,
        blue,
        0
    ))
    basic.pause(1000)
})
serial.writeLine("I2C ISL 29125")
// send to 0x44, register 0x00, value 0x46 (RESET
// ISL29125)
pins.i2cWriteNumber(68, 70, NumberFormat.UInt16BE)
// send to 0x44, register 0x01, value 0x05 (GRB
// SAMPLING)
pins.i2cWriteNumber(68, 261, NumberFormat.UInt16BE)

Credits

Holadiho g9t92k0hwa
Stephan Noller
7 projects • 8 followers
Contact
276461
Matthias L. Jugel
3 projects • 6 followers
Hacker, dad. I flash devices for fun. Mostly stuff works for me...
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaBlog