I have a RGB LED in my project. When I power on my Panda II, the LED displays as a faint green and then displays as a much brighter blue. The blue color remains until my code changes the color to a cyan color. How do I keep the RGB LED powered off until my code changes the LED to cyan?
FYI, the RGB LED is bright blue before the FOR loop executes to flash the onboard LED.
Further, this behavior continues even if I remove the code that creates the PWM[] named rgb. Just having the RGB LED plugged into the breadboard is enough to have it display a faint green before becoming bright blue. This doesn’t appear to be related to my code.
public class Program
{
static Thread thread;
static PWM[] rgb = new PWM[]
{
new PWM((PWM.Pin)FEZ_Pin.PWM.Di5),
new PWM((PWM.Pin)FEZ_Pin.PWM.Di6),
new PWM((PWM.Pin)FEZ_Pin.PWM.Di10)
};
public static void Main()
{
// Enable the Ethernet
WIZnet_W5100.Enable(SPI.SPI_module.SPI1, (Cpu.Pin)FEZ_Pin.Digital.Di10, (Cpu.Pin)FEZ_Pin.Digital.Di7, true);
Dhcp.EnableDhcp(new byte[] { 0x00, 0x26, 0x1C, 0x7B, 0x29, 0xE8 }, "FEZ Temp/Light");
// Show we've started by blinking the LED
bool ledState = false;
OutputPort led = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, ledState);
for (int i = 0; i < 20; i++)
{
ledState = !ledState;
led.Write(ledState);
Thread.Sleep(100);
}
// Begin sampling the temperature
thread = new Thread(TempFromMaximIc);
thread.Priority = ThreadPriority.Normal;
thread.Start();
//TempFromMaximIc();
}