Skip to content

Commit 0d0e2ee

Browse files
FischerMoseleyfischermoseley
andcommitted
Updated naming convention for getter and setter methods
Co-Authored-By: Fischer Moseley <fischermoseley@users.noreply.github.com>
1 parent debc555 commit 0d0e2ee

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ script:
1616
- arduino --verify --board arduino:avr:uno $PWD/examples/Example3_SetFilterCoefficient/Example3_SetFilterCoefficient.ino
1717
- arduino --verify --board arduino:avr:uno $PWD/examples/Example4_SetResolution/Example4_SetResolution.ino
1818
- arduino --verify --board arduino:avr:uno $PWD/examples/Example5_BurstMode/Example5_BurstMode.ino
19-
- arduino --verify --board arduino:avr:uno $PWD/examples/Example6_ConfigureTemperatureAlert/Example6_ConfigureTemperatureAlert.ino
19+
- arduino --verify --board arduino:avr:uno $PWD/examples/Example6_ConfigureTemperatureAlert/Example6_ConfigureTemperatureAlert.ino
2020
notifications:
2121
email:
2222
on_success: change

src/SparkFun_MCP9600.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,25 @@ bool MCP9600::checkDeviceID(){
5151

5252
/*----------------------------- Sensor Measurements ---------------------*/
5353

54-
float MCP9600::thermocoupleTemp(bool units){
54+
float MCP9600::getThermocoupleTemp(bool units){
5555
int16_t raw = readDoubleRegister(HOT_JUNC_TEMP);
5656
float celcius = ((float)raw * DEV_RESOLUTION);
5757
units ? return celcius; : return (((float)celcius * 1.8f) + 32);
5858
}
5959

60-
float MCP9600::ambientTemp(bool units){
60+
float MCP9600::getAmbientTemp(bool units){
6161
int16_t raw = readDoubleRegister(COLD_JUNC_TEMP);
6262
float celcius = ((float)raw * DEV_RESOLUTION);
6363
units ? return celcius; : return (((float)celcius * 1.8f) + 32);
6464
}
6565

66-
float MCP9600::tempDelta(bool units){
66+
float MCP9600::getTempDelta(bool units){
6767
int16_t raw = readDoubleRegister(DELTA_JUNC_TEMP);
6868
float celcius = ((float)raw * DEV_RESOLUTION);
6969
units ? return celcius; : return (((float)celcius * 1.8f) + 32);
7070
}
7171

72-
signed long MCP9600::rawADC(){
72+
signed long MCP9600::getRawADC(){
7373
for(byte attempts; attempts <= retryAttempts; attempts++){
7474
_i2cPort->beginTransmission(DEV_ADDR);
7575
_i2cPort->write(RAW_ADC);
@@ -84,7 +84,7 @@ signed long MCP9600::rawADC(){
8484
}
8585
}
8686

87-
bool MCP9600::inputRangeExceeded(){
87+
bool MCP9600::isInputRangeExceeded(){
8888
uint8_t status = readSingleRegister(SENSOR_STATUS);
8989
return bitRead(status, 4);
9090
}

src/SparkFun_MCP9600.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ class MCP9600{
106106
bool resetToDefaults(); //Resets all device parameters to their default values. Returns 1 if there was an error, zero otherwise.
107107

108108
//Sensor measurements
109-
float thermocoupleTemp(bool units = true); //Returns the thermocouple temperature. Set units to true for Celcius, or false for freedom units (Fahrenheit)
110-
float ambientTemp(bool units = true); //Returns the ambient (IC die) temperature. Set units to true for Celcius, or false for freedom units (Fahrenheit)
111-
float tempDelta(bool units = true); //Returns the difference in temperature between the thermocouple and ambient junctions. Set units to true for Celcius, or false for freedom units (Fahrenheit)
112-
signed long rawADC(); //Returns the raw contents of the raw ADC register
113-
bool inputRangeExceeded(); //Returns true if the MCP9600's EMF range has been exceeded, and false otherwise.
109+
float getThermocoupleTemp(bool units = true); //Returns the thermocouple temperature. Set units to true for Celcius, or false for freedom units (Fahrenheit)
110+
float getAmbientTemp(bool units = true); //Returns the ambient (IC die) temperature. Set units to true for Celcius, or false for freedom units (Fahrenheit)
111+
float getTempDelta(bool units = true); //Returns the difference in temperature between the thermocouple and ambient junctions. Set units to true for Celcius, or false for freedom units (Fahrenheit)
112+
signed long getRawADC(); //Returns the raw contents of the raw ADC register
113+
bool isInputRangeExceeded(); //Returns true if the MCP9600's EMF range has been exceeded, and false otherwise.
114114

115115
//Measurement configuration
116116
bool setAmbientResolution(Ambient_Resolution res); //Changes the resolution on the cold (ambient) junction, for either 0.0625 or 0.25 degree C resolution. Lower resolution reduces conversion time.

0 commit comments

Comments
 (0)