I'm using a 4x7segment LED display from Gravitech:
I need the display to be ON for certain states, and OFF for others. When it's off there should be no power to the LEDs.
I've been hunting all over the place, but I can't find any documentation that explains how to send that sort of a command to the I2c bus. I also tried power the display using a digital out pin, and setting that pin to LOW during certain cases. But then the display didn't light when it should have, either.
Why not just turn off all the segments? If that doesn't work for whatever reason, connect the ground pin of the display to an arduino digital pin. When you want the display to be on, set the pin as an output and low. When you want it to be off, set the pin as an input. This is a high-z (high impedance) state, and no current will flow through the display.
I'll try routing the ground tomorrow first thing. I tried that with the +5v leg, and just assumed the ground would work the same.
But let's assume that doesn't work.... how would I turn off the segments? I can't find any list of commands beyond the few that are mentioned on the arduino wire library reference page.
The reason why your method didn't work was an arduino pin cannot source enough current to power the leds. It can easily sink that much, however. Switching from LOW to Input on the ground pin is like connecting or disconnecting the ground wire. You either allow power to flow to the led board, or you don't. It will work.
Its not the wire reference page that will help you. Wire is a library to communicate over i2c. You should be looking at the manufacturers page and the data sheet. I believe the following sequence would work. However, it will not cut off all power to the LED controller as the previous method did.:
The reason why your method didn't work was an arduino pin cannot source enough current to power the leds. It can easily sink that much, however
Source and sink currents are pretty much the same for the AVR family.
The datasheet says that each port can source 100ma, with no per-pin limit. I would still guess that this method works better than sourcing power from a GPIO...