-
Notifications
You must be signed in to change notification settings - Fork 28
Set-i2cdevice overload to support arrays #35
Comments
Thanks for this Daniel! Did you mean |
Oh yes... I wrote it from my memory 😅 |
This is the case of really bad documentation but this is already supported!
|
So if you have a custom object array and pass that into Set-I2CRegister it should work:
Note: haven't tested that code ^ but I'm pretty sure it works. |
Oh I see... although it's only valid to set an array of values into a register, not a 1 to 1 relation, aka, 1 register 1 value. But this might only be useful in my case, i don't know... |
You want to do 1 value to many registers? |
No. I want an array of 5 registers and an array of 5 values and use register[i] value[i]. But then again, I don't have much experience to say that this would be a common situation on I2C protocol... Might only be useful in my case |
Wait I just realized that you said "not a 1 to 1 relation" to my example above. My example above IS a 1 to 1 example. You have an array of custom objects that contain a register and a value property. When you pipe the array into |
I think it would be good to have an overload that would accept an array of registers and an array of values to be set on those registers, 'freeing' the developer to have the necessity to create a loop to iterate each array and set each value
The text was updated successfully, but these errors were encountered: