Netduino

From air
Jump to navigation Jump to search

Les cartes Netduino sont des cartes de prototypage rapide utilisant un micro-contrôleur ARM7, programmables en langage C# et avec des connecteurs femelles compatibles avec les cartes empilables (shield) produites pour les cartes Arduino. La carte Netduino Plus intègre directement un port Ethernet et une socket pour une carte Flash MicroSD.

Hardware

  • Netduino
    • Atmel ARM7 48MHz, 128 KB Flash, 60 KB RAM
    • 20 GPIOs with SPI, I2C
    • 2 UARTs (1 RTS/CTS)
    • 4 PWM and 6 ADC channels
  • Netduino Plus
    • + Micro SD + Ethernet

Development

  • .NET MF C#
  • Visual Studio Express
  • SharpDevelop ???

Code sample

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;

/* NOTE: make sure you change the deployment target from the Emulator to your Netduino before running this
 * Netduino sample app.  To do this, select "Project menu > Blinky Properties > .NET Micro Framework" and 
 * then change the Transport type to USB.  Finally, close the Blinky properties tab to save these settings. */

namespace Blinky
{
    public class Program
    {
        public static void Main()
        {
            // write your code here
            OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);

            while (true)
            {
                led.Write(true);
                Thread.Sleep(250);
                led.Write(false);
                Thread.Sleep(250);
            }

        }

    }
}