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.
Dependents: app-board-TempAlarm LM75B IoTWorkshopSensors EduRobot ... more
Revision 15:69991c038abe, committed 2014-05-02
- Comitter:
- neilt6
- Date:
- Fri May 02 17:28:17 2014 +0000
- Parent:
- 14:3a44310726fe
- Child:
- 16:7ac462ba84ac
- Commit message:
- Added an I2C frequency argument to the constructor
Changed in this revision
| LM75B.cpp | Show annotated file Show diff for this revision Revisions of this file |
| LM75B.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/LM75B.cpp Tue Nov 12 17:22:12 2013 +0000
+++ b/LM75B.cpp Fri May 02 17:28:17 2014 +0000
@@ -16,10 +16,10 @@
#include "LM75B.h"
-LM75B::LM75B(PinName sda, PinName scl, Address addr) : m_I2C(sda, scl), m_ADDR((int)addr)
+LM75B::LM75B(PinName sda, PinName scl, Address addr, int hz) : m_I2C(sda, scl), m_ADDR((int)addr)
{
- //Set the I2C bus frequency to 400kHz
- m_I2C.frequency(400000);
+ //Set the I2C bus frequency
+ m_I2C.frequency(hz);
}
bool LM75B::open()
--- a/LM75B.h Tue Nov 12 17:22:12 2013 +0000
+++ b/LM75B.h Fri May 02 17:28:17 2014 +0000
@@ -100,8 +100,9 @@
* @param sda The I2C data pin.
* @param scl The I2C clock pin.
* @param addr The I2C slave address (defaults to ADDRESS_0).
+ * @param hz The I2C bus frequency (defaults to 400kHz).
*/
- LM75B(PinName sda, PinName scl, Address addr = ADDRESS_0);
+ LM75B(PinName sda, PinName scl, Address addr = ADDRESS_0, int hz = 400000);
/** Probe for the LM75B and indicate if it's present on the bus
*
LM75B Temperature Sensor
LPC General Purpose Shield OM13082