ADM-201 dump PMP dumps pdf SSCP exam materials CBAP exam sample questions

乐高颜色传感器:第二部分 – 译学馆
最新评论 (0)


EV3 Color Sensor (Part 2)

Continuing the discussion of the color sensor, we’ll discuss here about the color sensor
检测到光线 这个传感器实际上本身就可以读取从0到1024的值
detecting light. The sensor itself, actually reads values from 0 to 1024. These are the
这是它读取到的原始值 然而 在编程的时候 你识别这些具有代表性的缩放值时
raw values that it reads. However, when programming, typically you read the scaled values, which
将是0到100的范围 0表示暗色 意味着颜色传感器读取到非常弱的光线
will be a 0 to 100 range. Zero represents dark, when the color sensor is reading very
而100表示最亮的颜色 意味着颜色传感器正在被光线直射
little light, and 100 represents the lighter colors, when the sensor is detecting lots
这表示着 在这两者之间有一个连续的灰度
of light. This means, that in between the two of them, will be a continuous grayscale
有从0到100的不同的值 在黑暗结束 这是当它被完全覆盖住的时候
of different values from 0 to 100. On the dark end, this is when it’s completely covered
在一个黑暗的屋子里 实际上你很少可以读取到这么低的值
up; it’s in a dark room, and actually, very rarely will you read values this low. Similarly,
同样的 你也读取不到100 除非有一个闪光灯或其他的一些光源直射到光敏电阻
you won’t get to 100, unless there’s a flashlight or some other light source directly shining
into the photo resistor. Sometimes, think of the color sensor not so much like an eyeball,
更像一台相机 而宁可说是更像一个眼球透过
which more representing like a camera, but rather more like an eyeball looking through
一根管子来识别物体表面的颜色 因为你只能读取到一个值的反馈
a tube that’s sort of getting a sense of what the surface is, as you only get one value
表示着这个传感器所感应到的 看这一边 这里 当传感器
back, representing what the sensor sees. Looking at the side, here, when the sensor is far
远离物体表面的时候 传感器会检测到一个有非常大的半径的圆锥状的范围
away from a surface, there’s actually going to be a very large radius at the base of this
cone that the sensor sees. And so you’ll often want to keep your sensor very close to the
这是为了保持距离短 让这个圆锥更短 并得到一个对它所检测物体的值的更好的反馈
surface, in order to keep that distance small, the cone shape smaller, and get a better representation
传感器进入工作状态 举个例子 当这条线被检测的时候
of what value it hits. This comes into play, for instance, when doing line detection, if
你是跟着这条线的 当你出了这条线 你可能会读取到在光线表面的值60
you’re following a line, when you’re outside the line, you might read a value on this light
当你完全越过这条线时 你可能会读取到一个值40
surface, like 60, and when you’re completely over the line, you might read a value like
当你精准的对准这条线时 这个光线传感器会直射到这条线的边缘
40. When you’re exactly on the line, and the light sensor is directly above the edge of
你将再次得到这个圆中的平均值 这种情况下你可能读取到其他值50
the line, again you’ll get an average of this circle, which case you might read something
当传感器进入工作状态时你会尝试去检测 因为50应该只是
like 50. This comes into play if you’re trying to detect is, because 50 should be that threshold
value that you use for detecting the line.