Back to 10ms period

As suggested in review comments, let's keep default 10ms period
pull/1706/head
Laurent Meunier 2016-05-04 08:59:57 +02:00
parent c9350f8e5a
commit 731148eb72
1 changed files with 3 additions and 3 deletions

View File

@ -19,13 +19,13 @@ float value = 0.75;
int main() {
#if defined(TARGET_FF_ARDUINO)
PwmOut pwm(D9);
int period_us = 40000; // allows to test various periods
int period_ms = 10;
pwm.period_us(period_us);
pwm.period_ms(period_ms);
pwm.write(value);
float result = floor(pwm.read() * 100 + 0.5) / 100; // round it to 0.xx
printf("PWM period = %dus with duty cycle: %d%%\n", period_us, (int) (result * 100));
printf("PWM period = %dms with duty cycle: %d%%\n", period_ms, (int) (result * 100));
notify_completion(result == value ? true : false);
#elif defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC11U24) || defined(TARGET_LPC4088) || defined(TARGET_LPC2460)