ARMmbed / ARMmbed/mbed-drivers

PwmOut on K64F does not work

Open
#158 8 comments 0 reactions 0 assignees View on GitHub
mirrored
Dominant language
C++
Stars
39
Forks
41
PR merge metrics
No merged PRs in 30d

Description

mbed Classic (works):

``` cpp
#include "mbed.h"
PwmOut led(D3);

int main() {
while(1) {
for(float p = 0.0f; p < 1.0f; p += 0.1f) {
led = p;
wait(0.1);
}
}
}
```

mbed OS, doesnt work:

``` cpp
static PwmOut led(D3);
float a = 0.0f;
static void blinky(void) {
a += 0.1f;
if (a > 1.0f) a = 0.0f;

led = a;
}

void app_start(int, char**) {
get_stdio_serial().baud(115200);
minar::Scheduler::postCallback(blinky).period(minar::milliseconds(100));
}
```

This is kind of a real problem for me, as a bunch of things I need to demo on Monday require PWM...

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the mbed OS example using PwmOut led(D3), app_start, and the blinky callback on a K64F board, then compare its behavior with the working mbed Classic example. Trace the PWM driver and K64F pin mapping involved in D3. Done means the demonstrated PWM output changes as the callback updates led.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.