Red de conocimiento informático - Material del sitio web - ¿Cómo ejecutar código C# en un microcontrolador?

¿Cómo ejecutar código C# en un microcontrolador?

Instale .Net Micro Framework SDK 4.1 y GHI Electronics NETMF 4.1 SDK y cree este tipo de proyecto de aplicación .Net Micro Framework/FEZ Panda II en Visual Studio 2010. Ingrese el siguiente código C# para compilar, implementar y ejecutar:

usando System.Threading;

usando GHIElectronics.NETMF.FEZ;

usando Microsoft.SPOT .NETMF .FEZ;

espacio de nombres FEZ_Panda_II_Application1

{

programa de clase pública

{

const interna int StateChangeDelay = 500; // milisegundos

const interna Cpu.Pin port = (Cpu.Pin)FEZ_Pin.Digital.LED;

public static void Main()

{

// Destella el LED en la placa de circuito

bool ledState = false;

OutputPort led = new OutputPort(port, ledState);

while (true)

{

Thread.StateChangeDelay);

// Cambiar estado del LED

ledState = !ledState ;

led.Write(ledState);

}