Skip to content

Isn't rawResultCopy always positive here ? #40

@lahirunirmalx

Description

@lahirunirmalx

it seems here doing some thing . is rawResultCopy == -32768 ever going to happen after abs() ?
all the other places you have done
int16_t rawResult = readRegister(ADS1115_CONV_REG);

void ADS1115_WE::setAutoRange(){
    setVoltageRange_mV(ADS1115_RANGE_6144);
    
    if(deviceMeasureMode == ADS1115_SINGLE){
        startSingleMeasurement();
        while(isBusy()){delay(0);}
    }
    // 
 int16_t rawResult = abs(readRegister(ADS1115_CONV_REG)); // here ?
    int16_t rawResultCopy = rawResult;
    if(rawResultCopy == -32768){
        rawResultCopy++; 
    }
    rawResultCopy = abs(rawResultCopy);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions