The second example in the Experimenters Kit takes 6 LEDs (2 green, 4 red) and a potentiometer.
Depending on the value you turn the potentiometer to, a different LED lights up.
Here is the 2nd project (completed). The 4 LEDs are there. The Experimenters kit ships with 2 Green and 4 Red LEDs. So that’s why I have mixed colors.
The blue piece (above the first green LED) is the potentiometer. You’ll want to use a small screwdriver to turn it. It’s a fairly precise pot. There are also 6 resistors (identical in value). One for each LED.
BTW, here is the robot I used for these projects. I know Brian will recognize it. All three of my NXT’s were in use, so I just grabbed one to use.
I started playing with this one once it was built. It seemed to work right off… except for one thing. The last LED on the right never lit up.
So, I started debugging. The NXT display shows the value of the pot at any given time. So I started matching numbers up to what was in the code.
The last LED should light up if the value of the pot exceeds 511. However, the pot never exceeds 511. The highest I was seeing was like 508 or so. Then it looped around into the negative.
So, I changed the code to make the last LED light up after 325. And everything worked beautifully.
1 response so far ↓
1 Experimenters Kit – RobotC Example 3 | Brick Labs // May 4, 2010 at 9:47 pm
[...] RSS ← Experimenters Kit – RobotC Example 2 [...]
Leave a Comment