Hello, World!

  1. Configure your Meadow development environment.
  2. Create a new C# Meadow Application project, name it HelloPulsy.
  3. Plug the longer leg (anode) of a blue LED into pin 13 and the other leg into GND: Diagram of a Meadow with a blue LED legs connected between ground and pin D13.
  4. Replace the template logic in MeadowApp.cs with the code below, then deploy and run:
using Meadow;
using Meadow.Devices;
using Meadow.Foundation.Leds;

namespace HelloPulsy
{
    // Change F7FeatherV2 to F7FeatherV1 for V1.x boards
    public class MeadowApp : App<F7FeatherV2>
    {
        PwmLed pwmLed;

        public override Task Initialize()
        {
            pwmLed = new PwmLed(Device.Pins.D13, TypicalForwardVoltage.Blue);
            return base.Initialize();
        }

        public override Task Run()
        {
            // pulse the LED
            pwmLed.StartPulse();
            return base.Run();
        }
    }
}

That’s it, you’re controlling a blue LED with a PWM signal, using Meadow.Foundation’s PwmLed driver!

Video of a Meadow pulsing a blue LED via pulse-width modulation.

Next up, check out how to work with sensors; which comprise a huge portion of the Meadow.Foundation peripheral library.

Next - Working with Sensors

 


These docs are open source. If you find an issue, please file a bug, or send us a pull request. And if you want to contribute, we'd love that too!