LPC11U24 PwmOut does not work with USB_MSD_SD_HelloWorld

10 May 2012
  • LPC11U24
  • USB_MSD_SD_HelloWorld example

When I edit the example and try and set a pin to a PWM out put.....

#include "mbed.h"
#include "USBMSD_SD.h"

PwmOut pwm(p10);              //added this line
USBMSD_SD sd(p5, p6, p7, p8);

int main()
{
    while(1);
}

.... I get this complier error....

Quote:

"identifier "PwmOut" is undefined" in file "/main.cpp", Line: 4, Col: 1

...is this a bug?

Many Thanks,

Joe.

11 May 2012

Hi Joe,

The USBMSD_SD_HelloWorld program comes with an older version of the mbed library that didn't include the PwmOut functionality.

To use PwmOut you'll need to update the mbed library to a newer version, this is very easy to do.

/media/uploads/stevep/mbed_lib_update.png

  1. Looking at your copy of the USBMSD program click on the mbed library
  2. You can see that it's currently on revision 29
  3. Revision 43 is available
  4. Click the button labelled "Update to the latest revision"

Afterwards your program should compile.

Steve

11 May 2012

thanks for you help Steve