NXC: NXT 2.0 color sensor in lamp mode
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXC: NXT 2.0 color sensor in lamp mode
I did the test with NXC, but I used a light sensor instead of the color sensor to determine the times. The color sensor update speed might be too much in sync with the other one's flashing light, and perhaps that is why you had the issue reading the flashing light. Using a light sensor (like I did) there wouldn't be that issue.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
-
- Posts: 117
- Joined: 27 Dec 2010, 19:27
Re: NXC: NXT 2.0 color sensor in lamp mode
Even though, it is strengh that I never get a value bigger than 7..8 percent. If it is a matter of sampling rate, I should get sometimes higher values and I don't.
BTW, does anyone knows what is the sample rate of the color sensor? I would guess that it is the same as the Light sensor, ~3ms, because it's still an analog sensor. The only thing that changes from the light sensor is the coloring LED possibilities. Well, I would say that the only sample rate that is slower is in COLORFULL mode, because it has to do 3 measures and some calculations.
It's just a blind shot. Any other guesses?
BTW, does anyone knows what is the sample rate of the color sensor? I would guess that it is the same as the Light sensor, ~3ms, because it's still an analog sensor. The only thing that changes from the light sensor is the coloring LED possibilities. Well, I would say that the only sample rate that is slower is in COLORFULL mode, because it has to do 3 measures and some calculations.
It's just a blind shot. Any other guesses?
-
- Posts: 323
- Joined: 29 Sep 2010, 05:03
Re: NXC: NXT 2.0 color sensor in lamp mode
The sample rate for the color sensor hardware is actually much higher, it is not a standard analogue sensor. It uses the ARM a2d inputs not the Avr a2d. However I think the standard firmware will only actually read the sensor values every 1ms so that is the sample rate you will see... When you use full color mode the firmware will perform all 3 readings one after the other (in the same 1ms period) so you should see the same sample rate for full color and for single color... Note that these timings are for reading the sensor values (which is fast), not switching modes (which is slow!).
Andy
Andy
-
- Posts: 117
- Joined: 27 Dec 2010, 19:27
Re: NXC: NXT 2.0 color sensor in lamp mode
That is a very good new! Thanks a lot for the information!
I'm curious, how did you get that information? By firmware inspection?
I'm curious, how did you get that information? By firmware inspection?
-
- Posts: 323
- Joined: 29 Sep 2010, 05:03
Re: NXC: NXT 2.0 color sensor in lamp mode
Yes I've spent a lot of time reading the Lego firmware. I also implemented the leJOS version of the color sensor driver...
Andy
Andy
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXC: NXT 2.0 color sensor in lamp mode
But, if the NXT reads the one (sensor) at the same time that the other is in transition (between colors), and it is always in sync, that would explain the low readings. Try using a second NXT to read it, that way they won't be in sync.ricardocrl wrote:Even though, it is strengh that I never get a value bigger than 7..8 percent. If it is a matter of sampling rate, I should get sometimes higher values and I don't...
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Who is online
Users browsing this forum: No registered users and 2 guests