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

Code gets stuck in while loop, after module lost power #4

Open
niphiwi opened this issue Aug 26, 2019 · 3 comments
Open

Code gets stuck in while loop, after module lost power #4

niphiwi opened this issue Aug 26, 2019 · 3 comments

Comments

@niphiwi
Copy link

niphiwi commented Aug 26, 2019

Hello,

I am using the 968-034 Digital Gas Sensor Module and recognized that the code gets stuck in this loop/function:

int DGS::getData(char c) {
[...]
  while (!_mySerial->available()) {
      }
[...]
}

This happens if the module loses power and gets reconnected to it again. By writing to the serial within the loop, I seem to have fixed this issue for me (see my fork of this repository):

int DGS::getData(char c) {
[...]
  while (!_mySerial->available()) {
        _mySerial->write(c);
      }
[...]
}

However, I am not sure, whether this is recommended or not...?

@dpeaslee
Copy link
Collaborator

dpeaslee commented Aug 27, 2019 via email

@niphiwi
Copy link
Author

niphiwi commented Aug 27, 2019

Hi, the module returns '15SEP17'.

@dpeaslee
Copy link
Collaborator

dpeaslee commented Aug 27, 2019 via email

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

2 participants