Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

PwmOut on K64F does not work #23

Closed
janjongboom opened this issue Feb 24, 2016 · 2 comments
Closed

PwmOut on K64F does not work #23

janjongboom opened this issue Feb 24, 2016 · 2 comments

Comments

@janjongboom
Copy link

In the other issue ppl said because it was D8, which was causing the problems, but it's not. D3 works fine in classic, doesn't work in mbed OS.

mbed Classic (works):

#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:

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...

@ciarmcom
Copy link
Member

ARM Internal Ref: IOTSFW-2126

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 29, 2016

Duplicate of ARMmbed/mbed-drivers#158. I am closing this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants