Lights
Robbie showed us how to transform the sensor ports into outputs using the following code:
Using the on8 and off8 commands, etc. we can turn the current in ports 6, 7, and 8 on and off. To adjust brightness, we make the lights flicker on and off so quickly that it is unnoticeable. For example, this program makes the lights only have current for half the time, making them half as bright.
On Tuesday, I went into the lab to test the number of LEDs we will be able to use. We wanted about 20 in each sphere, so I tried out powering 20 at once:
They were still satisfactorily bright, not nearly as bright as a single one would be, but more lights, rather than brighter lights, would be more appealing with our sphere idea. But, I wanted to compare the many lights to the brightness of a single light, so I connected one light to the next port.
Here I ran into a problem. Turning on power to one port shuts off power to the other ports, so a program reading "on8 on7" would only turn on port 7. As far as I can tell from messing with the underlying code, they can't be turned on simultaneously, though I will have to ask Robbie about this on Wednesday. To solve this, I wrote a program that switches power between the two ports every 2 ms. However, this has the same effect as the dimming program from earlier. The ports can't be at full brightness at the same time, since power is switching back and forth.
In this situation, the 20 lights are probably not bright enough:
From here, I experimented with smaller numbers of lights to see how many would be able to still be bright enough with only half-power.
It seems like 12 is a good number for each group of lights, since they can still be quite bright while sharing power with another group.
No comments:
Post a Comment