Hi @Eliza143145, your link is broken so I’m having trouble finding the library you’re pointing to:

However, if that doesn’t pan out there are other ways…
To expand on @Mitchell’s reply, you may be up for a little legwork but it’s not so bad. Without a library you can still work with the device. Things will just be a little more manual, but you can still pre-bake some code for students; to conceal the inner-workings and keep the experience very understandable.
You can create your own functions in makecode to
- Initialise the device
- Perform a reading
You work with i2c devices by writing data to- and reading data from registers. You will need to dig into the color sensor manual to work out the commands that you will need to send with i2c write and i2c read.
Following the rabbit hole for the device you linked, we can find the manual/datasheet
And digging in, we can find the register table. A good hello world script is to attempt to read the device ID, since you know exactly what data it’s going to return
If you have access to a logic analyser at your university, that could be an invaluable debugging tool - you will be able to see the data flowing back and forth to make sure the system is working.
After your hello-world, you will need to write a function that initialises the device (sets it up to perform the measurements you want) and another to read the colour data. Your students will need to include your functions in their code, but that’s no big deal. Instruct them to copy+paste the functions in and you’re ready to roll.
Here’s some pseudocode to give you inspiration
function initialiseSensor() {
// Write to appropriate registers to set up the device
pins.i2cWriteRegister(0, 0, 0) // your setup code here
pins.i2cWriteRegister(0, 0, 0) //
pins.i2cWriteRegister(0, 0, 0) //
}
function readColor() {
// read data from appropriate registers
let grnHi = pins.i2cReadRegister(0, 0)
let grnLo = pins.i2cReadRegister(0, 0)
let redHi = pins.i2cReadRegister(0, 0)
let redLo = pins.i2cReadRegister(0, 0)
let bluHi = pins.i2cReadRegister(0, 0)
let bluLo = pins.i2cReadRegister(0, 0)
// etc
let data = // something to concatenate / process the data
return data
}