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.
Diff: PCA9685.h
- Revision:
- 2:fa75aff130cc
- Parent:
- 1:6e7731f14aac
- Child:
- 3:f69f4e2c35b6
--- a/PCA9685.h Tue Nov 07 14:28:19 2017 +0000
+++ b/PCA9685.h Tue Nov 07 14:52:15 2017 +0000
@@ -332,6 +332,24 @@
} PCA9685_status_t;
+// MACRO: round function
+#define _MYROUND( x ) ({ \
+ uint32_t aux_pre; \
+ float aux_x; \
+ \
+ aux_x = (x); \
+ aux_pre = (x); \
+ aux_x -= aux_pre; \
+ aux_x *= 10; \
+ \
+ if ( aux_x >= 5 ) \
+ aux_pre++; \
+ \
+ aux_pre; \
+ })
+
+
+
/** Create an PCA9685 object connected to the specified I2C pins.