Skip to content

Beter initialization - I2C #2

Description

my suggestion

bool DFRobot_GM60_IIC::begin(){
if(_pWire){
_pWire->begin();
_pWire->beginTransmission(_deviceAddr);
_pWire->write(0xaa);
byte error = _pWire->endTransmission();
communication=1;
if (error>0) {communication=0; return false;}
return DFRobot_GM60::begin();
} else return false;
}

then in main you can easy init the modul

//Init chip QR CODE SCANNER
if(gm60.begin()==true){
gm60.encode(gm60.eUTF8);
gm60.setupCode(/on =/true,/content=/true);
gm60.setIdentify(gm60.eEnableAllBarcode);
if(Serial_) Serial.println("Start to recognize");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions