@@ -87,7 +87,7 @@ void VCNL4010::writeByte(const uint8_t addr, const uint8_t data) { //
87
87
** 111 250 **
88
88
** These roughly equate to Hz (2,4,8,16,32,64,128 and 256) **
89
89
*******************************************************************************************************************/
90
- void VCNL4010::setProximityHz (const uint8_t Hz= 2 ) { // //
90
+ void VCNL4010::setProximityHz (const uint8_t Hz) { // //
91
91
uint8_t setValue; // temp variable for sampling rate //
92
92
if (Hz>250 ) setValue = 7 ; // If value is bigger then set max //
93
93
else if (Hz>=128 ) setValue = 6 ; // //
@@ -103,7 +103,7 @@ void VCNL4010::setProximityHz(const uint8_t Hz=2) { //
103
103
** Method setLEDmA() sets the IR LED current output in milliamps. Range is between 0mA and 200mA, internally set **
104
104
** in steps of 10mA with input values being truncated down to the next lower value **
105
105
*******************************************************************************************************************/
106
- void VCNL4010::setLEDmA (const uint8_t mA = 20 ) { // //
106
+ void VCNL4010::setLEDmA (const uint8_t mA ) { // //
107
107
writeByte (VCNL4010_LED_CURRENT_REG,(uint8_t )(mA /10 )); // Divide by 10 and write register //
108
108
} // of method setLEDmA() // //
109
109
/* ******************************************************************************************************************
@@ -113,7 +113,7 @@ void VCNL4010::setLEDmA(const uint8_t mA=20) { //
113
113
** 10 = 1.5625 MHz **
114
114
** 11 = 3.125 MHz **
115
115
*******************************************************************************************************************/
116
- void VCNL4010::setProximityFreq (const uint8_t value= 0 ) { // Set Frequency value from list //
116
+ void VCNL4010::setProximityFreq (const uint8_t value) { // Set Frequency value from list //
117
117
uint8_t registerSetting = readByte (VCNL4010_PROXIMITY_TIMING_REG); // Get the register settings //
118
118
registerSetting &= B11100111; // Mask the 2 timing bits //
119
119
registerSetting |= (value&B00000011) << 3 ; // Add in 2 bits from value //
@@ -123,7 +123,7 @@ void VCNL4010::setProximityFreq(const uint8_t value=0) { //
123
123
** Method setAmbientLight() sets the number of samples taken per second and the number of samples averaged to **
124
124
** make a reading; each reading takes only 300microseconds and the default period for a measurement is 100ms. **
125
125
*******************************************************************************************************************/
126
- void VCNL4010::setAmbientLight (uint8_t sample= 2 , uint8_t avg= 32 ) { // //
126
+ void VCNL4010::setAmbientLight (uint8_t sample, uint8_t avg) { // //
127
127
sample--; // subtract one for offset //
128
128
if (sample==6 ) sample==5 ; // Adjust nonexistent values //
129
129
else if (sample==8 ) sample==6 ; // //
@@ -190,7 +190,7 @@ uint8_t VCNL4010::getInterrupt() { //
190
190
** Bit 0 - high threshold interrupt **
191
191
** The bit needs to be written as "1" in order to clear it, so send the bitwise not value **
192
192
*******************************************************************************************************************/
193
- void VCNL4010::clearInterrupt (const uint8_t intVal= 0 ) { // Set Interrupt bits //
193
+ void VCNL4010::clearInterrupt (const uint8_t intVal) { // Set Interrupt bits //
194
194
writeByte (VCNL4010_INTERRUPT_STATUS_REG,~intVal); // Write value to register //
195
195
} // of method clearInterrupt() // //
196
196
/* ******************************************************************************************************************
@@ -200,13 +200,13 @@ void VCNL4010::clearInterrupt(const uint8_t intVal=0) { //
200
200
** trigger an interrupt on threshold low or high value being exceeded for Proximity and ALS. Since only one can **
201
201
** be used the ALS is chosen when both are set. Finally the low and high threshold values themselves **
202
202
*******************************************************************************************************************/
203
- void VCNL4010::setInterrupt (const uint8_t count = 1 , // //
204
- const bool ProxReady = false , // //
205
- const bool ALSReady = false , // //
206
- const bool ProxThreshold = false , // //
207
- const bool ALSThreshold = false , // //
208
- const uint16_t lowThreshold = 0 , // //
209
- const uint16_t highThreshold = UINT16_MAX ) { // //
203
+ void VCNL4010::setInterrupt (const uint8_t count , // //
204
+ const bool ProxReady , // //
205
+ const bool ALSReady , // //
206
+ const bool ProxThreshold , // //
207
+ const bool ALSThreshold , // //
208
+ const uint16_t lowThreshold , // //
209
+ const uint16_t highThreshold ) { // //
210
210
uint8_t registerValue = 0 ; // Default to 1 count //
211
211
if (count>=128 ) registerValue = B111; // Choose setting based on parameter//
212
212
else if (count>=64 ) registerValue = B110; // //
@@ -231,7 +231,7 @@ void VCNL4010::setInterrupt(const uint8_t count = 1, //
231
231
/* ******************************************************************************************************************
232
232
** Method setAmbientContinuous() sets or unsets the continuous measurement mode for the ambient light sensor **
233
233
*******************************************************************************************************************/
234
- void VCNL4010::setAmbientContinuous (const bool ContinuousMode= true ) { // Cont. Ambient sampling on/off //
234
+ void VCNL4010::setAmbientContinuous (const bool ContinuousMode) { // Cont. Ambient sampling on/off //
235
235
uint8_t commandBuffer = readByte (VCNL4010_COMMAND_REG); // get the register contents //
236
236
commandBuffer &= B11111010; // Mask the 2 relevant bits //
237
237
if (ContinuousMode==true ) { // If we are turning on then write //
@@ -247,7 +247,7 @@ void VCNL4010::setAmbientContinuous(const bool ContinuousMode=true) { //
247
247
/* ******************************************************************************************************************
248
248
** Method setProximityContinuous() sets or unsets the continuous measurement mode for the proximity sensor **
249
249
*******************************************************************************************************************/
250
- void VCNL4010::setProximityContinuous (const bool ContinuousMode= true ) { // Cont. Proximity sampling on/off //
250
+ void VCNL4010::setProximityContinuous (const bool ContinuousMode) { // Cont. Proximity sampling on/off //
251
251
uint8_t commandBuffer = readByte (VCNL4010_COMMAND_REG); // get the register contents //
252
252
commandBuffer &= B11111100; // Mask the 2 relevant bits //
253
253
if (ContinuousMode==true ) { // If we are turning on then write //
0 commit comments