sharpbrick / powered-up

.NET implementation of the LEGO PoweredUp Protocol
MIT License
98 stars 19 forks source link

ColorDistanceSensor: What are those additional modes doing? #151

Open dkurok opened 3 years ago

dkurok commented 3 years ago

@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 commented 3 years ago

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

highstreeto commented 3 years ago

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.

tthiery commented 3 years ago

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 commented 3 years ago

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

dlech commented 3 years ago

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.

tthiery commented 3 years ago

@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!!!

highstreeto commented 3 years ago

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

dkurok commented 3 years ago

@highstreeto & @tthiery I would like to extend ColorDistanceSensor-device with the output-functions for

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?

highstreeto commented 3 years ago

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