Need help

Hello,

today i get my panda 2 baord,.
But i cant define a variable as an outputport.
my programm:


using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHI.Hardware.EMX;
using GHI.Premium.Hardware;

namespace Panda_test_1
{
    public class Program
    {
        public static void Main()
        {
            OutputPort LED;

            LED = new OutputPort(EMX.Pin.IO20, true);
           
        }

    }
}

i just want to turn on and off an led, im totally new to programmin a microcontroler board.

my problem is that i cant use emx, (red underlined like wrong word in office :-P),
i added the properties in the solution browser, and installied the SDK (4.2) correctly.
im trying now for nearly an hour and nothing works.

please heelb my.

greetings
Kevin

ps sorry for my bad english

Hello Kevin,

Welcome to the community.

You will need to use the 4.1 SDK for the Panda II board which uses the USBizi chipset. The SDK can be found at the bottom of this page: http://www.ghielectronics.com/support/.net-micro-framework under Legacy.

Your program is generally correct with the exception of using EMX instead of USBizi or PandaII.

Plus, you will need to select 4.1 under the properties manager of the Solution as Panda II is not supported under 4.2.

thanks for the quick response.

but it still doens works.
I installed the 4.1 SDK
i added
using FEZPanda_II_GHIElectronics.NETMF.FEZ;
to the programm an added the
FEZPanda_II_GHIElectronics.NETMF.FEZ.dll
manually.

but i get an error that the namespace FEZPanda_II_GHIElectronics.NETMF.FEZ could not be found althoug is is listed in the solution browser.

Replace using FEZPanda_II_GHIElectronics.NETMF.FEZ;
with using GHIElectronics.NETMF.FEZ;

That should resolve your issue.

nice it works,
althoug i canged to 4.1, visual studio changed it back to 4.2.
changed it again, replaced using FEZPanda_II_GHIElectronics.NETMF.FEZ;
with using GHIElectronics.NETMF.FEZ;
Now it works.
thank you for you help :-).

Glad to hear that it is working.

As for the reversion back to 4.2, any new project will start as 4.2 because I believe it is dependent on the current NetMF SDK you have installed, which in your case is probably 4.2. For me, I have the 4.3 SDK installed and it defaults all console programs to 4.3. In order for me to use 4.2, I just need to change it the one time when the project is saved.

i wrote another very simpel programm but when i try to debug i get an error:

i searched for this but didnt found anything useful.

my programm

using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.FEZ;
using GHIElectronics.NETMF.Hardware;
using System.Threading;

namespace panda_test_2
{
    public class Program
    {
        public static void Main()
        {
            int n=0;
            InputPort tin;
            OutputPort LED;

            tin = new InputPort((Cpu.Pin)FEZ_Pin.Digital.Di21, true, Port.ResistorMode.PullDown);
            LED = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.Di22, true);

            while (true)
            {
                if (tin.Read())
                {
                    n++;
                    LED.Write(true);
                    Thread.Sleep(500);
                    LED.Write(false);
                }
            }

        }

    }
}

If you step through your code, at which line does this error occur?

at
tin = new InputPort((Cpu.Pin)FEZ_Pin.Digital.Di21, true, Port.ResistorMode.PullDown);

It may be due to using the glitch filter on an input port that does not support interrupts. Glitch filter requires an interrupt capable input GPIO in order to function. Try to replace true with false to see if that will solve the issue. If you need a glitch filter, you may need to try a different port that is interrupt capable.

@ Kevin23 - You can only use a glitch filter on ports that support interrupts. Di21 does not support interrupts.

ok, i used pin 37 and now it works.