10 years, 2 months ago.

PWM problem

I am trying to just get an LED to fade and brighten on a LPC11U24 board. I have tried several pwm programs from the cookbook but all that happens is the 4 LED's flash first the 2 outer ones then the 2 inner ones indefinitely. Even with the following program the same thing happens. There are no other programs on the memory card. What am I doing wrong. The basic LED flash program works.

Program:-

  1. include "mbed.h"

Change brightness of LED using Pwmout function.

/**

  • \brief LED to control
  • / PwmOut myled(LED1);

/**

  • \brief main program
  • / int main() {

myled = 0.1;

}

1 Answer

10 years, 2 months ago.

On the LPC11u24 those LEDs are not connected to PWM pins. What you see is the error pattern: It cannot map the pins to a PWM peripheral.

Accepted Answer