Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 7 months ago.
PWM BUG?
Hello,
is there a bug with PWM??
Connect to your mbed Microcontroller with a Terminal program and uses the 'u' and 'd' keys to make LED1 brighter or dimmer
- include "mbed.h"
Serial pc(USBTX, USBRX); tx, rx PwmOut led(LED1);
float brightness = 0.0;
int main() { pc.printf("Press 'u' to turn LED1 brightness up, 'd' to turn it down\n");
while(1) { char c = pc.getc(); if((c == 'u') && (brightness < 0.5)) { brightness += 0.01; led = brightness; } if((c == 'd') && (brightness > 0.0)) { brightness -= 0.01; led = brightness; }
} }
The syntax is correct but on my terminal i get the message "pinmap not found for peripheral" and the 4 LEDs toggel... NO PWM.
Whats the Problem here?
Thank you
Question relating to:
2 Answers
11 years, 7 months ago.
Hi, are you sure the LPC11U24 has no PWM? It looks like there are several pins for PWM, but NOT the LEDs: http://mbed.org/handbook/PwmOut#lpc11u24
Hey David,
i search in the Dokumentation of LPC11U24, this controller doesn't have PWM... but i'm not realy shure. In the exampel the PWM Pin LED1 is modulating but if i do this all LEDs are toggeling.
the Handbook isn't realy a helb becaouse he did PWM with Timers.
Thanks for answare
posted by 16 Apr 2013