Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 6:ee990cddff48, committed 2016-01-27
- Comitter:
- yuhki50
- Date:
- Wed Jan 27 18:07:11 2016 +0000
- Parent:
- 5:a4dfe2bb80b9
- Child:
- 7:c82a0d54a024
- Commit message:
- fix enableIROut method
Changed in this revision
| irSend.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/irSend.cpp Sat Jan 23 15:58:10 2016 +0000
+++ b/irSend.cpp Wed Jan 27 18:07:11 2016 +0000
@@ -1,5 +1,6 @@
#include "IRremote.h"
#include "IRremoteInt.h"
+#include "cmath"
//+=============================================================================
void IRsend::sendRaw (unsigned int buf[], unsigned int len, unsigned int hz)
@@ -51,7 +52,7 @@
void IRsend::enableIROut (int khz)
{
_pwm.write(0.0);
- _pwm.period_us(1 / khz * 1000);
+ _pwm.period_us(std::floor((1.0 / khz * 1000) + 0.5)); // round
}
//+=============================================================================