Main Site Documentation

Accessing the on board LED


#1

Hi
We’re 2 university students from Spain
We need to access the on board LED to make it blink but we don’t know how to reach it. We have a code that worked on a simulator but doesn’t work on the chipworkx board since we don’t know what direction (pin) should we point the class to, when constructing.

using System;
using System.Threading;
using Microsoft.SPOT.Hardware;
namespace GpioOutputPortSample
{
    public class Program
    {
        public static void Main()
        {
            OutputPort outputPort = new OutputPort(Cpu.Pin.GPIO_Pin0, true);
            while (true)
            {
                Thread.Sleep(500);
                outputPort.Write(!outputPort.Read()); //toggle port
            }
        }
    }
}

Could you give us a hand? Also are there examples like this somewhere?

Thanks


#2

Already solved it. If anyone has the issue:

OutputPort led = new OutputPort((Cpu.Pin)ChipworkX.Pin.PC5,true);

#3

Yes all LEDs/buttons should be marked on the board