Can you explain how i2c commands are formed?

grovepi
i2c

#1

In this example: https://github.com/DexterInd/GrovePi/blob/master/Software/Go/grovepi/grovepi.go#L99

we are preparing a command for the i2c, in the shape of “[]byte{CommandDHTRead, pin, 0, 0}”. Why do we need these for values in bytes there? What is the i2c bus using that for?


#2

Hi @LuCavallin,

I2C protocol sends data byte after byte, so it kind of makes sense to group them as a byte array, doesn’t it? I’m assuming you’re talking about why we’re using bytes instead of just using a list or something, right?