Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beter initialization - I2C #2

Open
david19610 opened this issue Jun 17, 2023 · 0 comments
Open

Beter initialization - I2C #2

david19610 opened this issue Jun 17, 2023 · 0 comments

Comments

@david19610
Copy link

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");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant