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.
Fork of MAG3110 by
Revision 5:760476084e70, committed 2014-02-12
- Comitter:
- mja054
- Date:
- Wed Feb 12 22:23:00 2014 +0000
- Parent:
- 4:cf40601402b7
- Commit message:
- Added a new constructor function.
Changed in this revision
| MAG3110.cpp | Show annotated file Show diff for this revision Revisions of this file |
| MAG3110.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/MAG3110.cpp Fri May 24 20:16:24 2013 +0000
+++ b/MAG3110.cpp Wed Feb 12 22:23:00 2014 +0000
@@ -5,6 +5,11 @@
/******************************************************************************
* Constructors
******************************************************************************/
+MAG3110::MAG3110(PinName sda, PinName scl, int addr): _i2c(sda, scl),
+ _i2c_address(addr), _pc(NULL), _debug(false)
+{
+ begin();
+}
MAG3110::MAG3110(PinName sda, PinName scl): _i2c(sda, scl),
_i2c_address(0x1D), _pc(NULL), _debug(false)
{
--- a/MAG3110.h Fri May 24 20:16:24 2013 +0000
+++ b/MAG3110.h Wed Feb 12 22:23:00 2014 +0000
@@ -86,6 +86,13 @@
* @param sdl SCL pin
* @param addr addr of the I2C peripheral
*/
+ MAG3110(PinName sda, PinName scl, int addr);
+ /**
+ * Main constructor
+ * @param sda SDA pin
+ * @param sdl SCL pin
+ * @param addr addr of the I2C peripheral
+ */
MAG3110(PinName sda, PinName scl);
/**
* Debug version of constructor
