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.
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.
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 :-).
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);
}
}
}
}
}
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.