powered-up icon indicating copy to clipboard operation
powered-up copied to clipboard

ColorDistanceSensor: What are those additional modes doing?

Open dkurok opened this issue 3 years ago • 9 comments

@highstreeto Do you know / found out hwat the additional modes of the 88007 do? public byte ModeIndexIRTx { get; protected set; } = 7; public byte ModeIndexSPEC1 { get; protected set; } = 8; public byte ModeIndexDebug { get; protected set; } = 9; public byte ModeIndexCalibration { get; protected set; } = 10;

IR sounds like Infrared; and it is an ouptput. Can we use it like an IR-control? Controlling PowerFunctions-devices?? That would be fun!

SPEC1 is neither input nor output according to "CLI device list" I have no idea! Sounds like "SPECIAL"

What can be done by calibration (input) on this device?

dkurok avatar Mar 30 '21 10:03 dkurok

Just found something interesting about the SPEC 1-mode here: Boost Color and Distance Sensor readings

dkurok avatar Mar 30 '21 13:03 dkurok

Not really. I played around a bit with CALIB, but it seems to just shut off when "triggering" this mode. My current understanding is that the sensor does a self-calibration on startup, as it switches through different modes (indicated by the color) and maybe the CALIB mode is for getting the calibration values? (more testing required).

If I find more out, I will add it to my PR at the sharpbrick/docs repo.

highstreeto avatar Mar 30 '21 17:03 highstreeto

I highly recommend not playing around with calibration call. Who knows what calibration procedure is executed in the LEGO facilities. Executed the wrong way, you might brick your brick 🙂

tthiery avatar Mar 30 '21 17:03 tthiery

@dkurok you will find out that in most devices there are undocumented modes.

tthiery avatar Mar 30 '21 18:03 tthiery

Can we use it like an IR-control? Controlling PowerFunctions-devices?? That would be fun!

Yes, this is possible with both the official Powered Up Control+ app and Pybricks.

I think SPEC1 is just a precursor to the multi-mode stuff on newer sensors. It allows measuring multiple values at the same time.

dlech avatar Mar 30 '21 18:03 dlech

@highstreeto May I present @dlech. He and his team are the level deeper and with some guys measuring the electric cables are the folks with the most knowledge outside of LEGO.

If you are interested in doing some stuff in this area, checkout their codebase, learn and apply it here and the docs repo ;)

@dlech As always, thanks for helping out!!!

tthiery avatar Mar 30 '21 18:03 tthiery

I highly recommend not playing around with calibration call. Who knows what calibration procedure is executed in the LEGO facilities. Executed the wrong way, you might brick your brick 🙂

Yeah, I just tested it once and never touched it again

Can we use it like an IR-control? Controlling PowerFunctions-devices?? That would be fun!

Yes, this is possible with both the official Powered Up Control+ app and Pybricks.

I think SPEC1 is just a precursor to the multi-mode stuff on newer sensors. It allows measuring multiple values at the same time.

Ah good to know. As I have no PF things, I cannot test/implement this.

@highstreeto May I present @dlech. He and his team are the level deeper and with some guys measuring the electric cables are the folks with the most knowledge outside of LEGO.

If you are interested in doing some stuff in this area, checkout their codebase, learn and apply it here and the docs repo ;)

@dlech As always, thanks for helping out!!!

Will do

highstreeto avatar Mar 31 '21 14:03 highstreeto

@highstreeto & @tthiery I would like to extend ColorDistanceSensor-device with the output-functions for - Mode 5: Name: COL O, Symbol: IDX, Capability: Output (letting the LED of the device shine) - Mode 7: Name: IR Tx, Symbol: N/A, Capability: Output (trying to get PF-motors/PF-devices to run; I've got enough of them) and the reading of

  • Mode 8: Name: SPEC 1, Symbol: N/A, Capability: (this seems to be a one-go fetch of values for distance, color and reflection)

This would change ColordistanceSensor.cs and extend the example for the sensor. Want to avoid two or more of us working on it. So is there interest in it from your side that I do it or is someone else working on it?

dkurok avatar Apr 01 '21 14:04 dkurok

This would change ColordistanceSensor.cs and extend the example for the sensor. Want to avoid two or more of us working on it. So is there interest in it from your side that I do it or is someone else working on it?

No interset from my side, so go for it

highstreeto avatar Apr 03 '21 13:04 highstreeto