Thanks for the immediate reply.
PFB the code snippet for the PWM & LED1 .
When PwmOut is not enabled, LED blinks every second but when I enabled the PwmOut , LED is not blinking every second but PWM pulses are observed at pin P0.16 on the oscilloscope.
I just want confirm whether this issue is nRF51-DK or Mbed Compiler related.
- include "mbed.h"
- include "PwmOut.h"
PwmOut VMPWM(P0_16); P0.16 for the PWM
DigitalOut led1(P0_21); P0.21 for LED
void periodicCallback(void) {
led1 = !led1;
}
int main(void) {
VMPWM.period(0.01f); 10 ms period
VMPWM = 0.2f; 20 %
Ticker ticker;
ticker.attach(periodicCallback,1); In Seconds.
while(1) ;
}
Hi
I am begineer to Mbed Compiler & want to use PWM protected member functions like unlock_deep_sleep() but it's giving compile time error like : Function "mbed::PwmOut::unlock_deep_sleep" (declared at /extras/mbed-os.lib/drivers/PwmOut.h:197) is inaccessible.
I would be grateful if you could suggest for the same.
Regards Bharat Gopani