Hey guys,
According to the G120 manual, this code should work, but does not.
I was able to blink the led in 4.2, but no luck since updating to 4.3
public static void Main()
{
// OutputPort LED = new OutputPort(Cpu.Pin.GPIO_Pin0, false);
OutputPort LED = new OutputPort(G120.P0_17, true);
Thread.Sleep(200);
for (int i = 0; i < 200; i++)
{
LED.Write(true);
Thread.Sleep(200);
LED.Write(false);
Thread.Sleep(200);
}
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHI.Pins;
public class Program
{
public static void Main()
{
OutputPort LED = new OutputPort(G120.P0_17, true);
while (true)
{
LED.Write(true);
Thread.Sleep(500);
LED.Write(false);
Thread.Sleep(500);
}
}
}
whoops … This may not be clear, but examples in that manual are not for Cobra II; they are for G120 SoM. In the example sited, the assumption is that the designer has attached an LED to the GPIO pin.
I tried both definitions in my attempt to blink the LED.
OutputPort LED = new OutputPort(Cpu.Pin.GPIO_Pin0, false);
and
OutputPort LED = new OutputPort(G120.P0_17, true);
Neither definition would change the state of the LED
If you can tell me the pin number of the LED on the Cobra II, i will try again.
Thanks for the quick reply.
Mike & Dave,
Thanks for the good suggestions and thoughts.
I am trying to drive the LED on the Cobra II.
Thanks Guys, I must admit that I seldom think about looking at the schematic. I figure the board s already build so why do I need the schematic! Wrong! A lesson learned for the future! Larry Scott