I2C Temprature Sensor Progemm MPL3115A2
Dependents: I2C_Temprature_raspiboard
Fork of MPL3115A2 by
Diff: Altitude.h
- Revision:
- 3:7c7c1ea6fc33
- Parent:
- 2:2ebc9c0d4a54
- Child:
- 4:c0ee6755d57f
diff -r 2ebc9c0d4a54 -r 7c7c1ea6fc33 Altitude.h --- a/Altitude.h Wed Apr 02 12:22:45 2014 +0000 +++ b/Altitude.h Wed Apr 02 12:59:44 2014 +0000 @@ -14,8 +14,8 @@ #include "mbed.h" -//! Casting truncates, therefore negative numbers become positive. -//! This will only cast properly in the range -128 to 127. +//! Casting a float to a char truncates, therefore negative numbers become positive. +//! This will properly cast a float in the range -128 to 127 to a char. #define float_to_char(x) (((x)<0)?(-(char)(x)):((char)(x))) //! Altitude provides a wrapper around altitude data coming from the sensor. The class handles