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

ReadPID is slow :( is there an alternative way to readPIDs that doesn't block code whilst waiting to receive the PID data? #63

Open
IAmOrion opened this issue Oct 20, 2019 · 0 comments

Comments

@IAmOrion
Copy link

IAmOrion commented Oct 20, 2019

I'm making a circuit that has an OLED display to display the values I've read, I have 2 buttons to change what is shown on the OLED, and I also have a strip of NeoPixels that are acting as an RPM / Shift light.

The problem I'm having, is that the NeoPixels don't update quick enough and the Display also has a pause between switching between displays. Also worth noting, I had to use interrupts for my buttons since they were unreliable using a "normal" method of checking for button inputs - again due to whatever is blocking code from this library.

If I fake the data, and don't use the library, everything works great - so why is the library code-blocking?

I've actually just edited this post as I thought it was due to using delay in the library, however I spotted the delays are only used in an I2C related function (so not relevant to my use case of UART) and also after setting the baud rate. So WHY is it pausing? Why does it make my sketch/arduino pause? (I'm actually using an Adafruit ItsyBitsy M0)

If I don't call "readPIDS" then everything is perfect, as soon as I need data, it delays everything but I don't get why.

Using millis() in functions to time the delay, it appears to be blocking for 400 - 500ms each loop

@IAmOrion IAmOrion changed the title ReadPID is code-blocking :( is there an alternative way to readPIDs? ReadPID is slow :( is there an alternative way to readPIDs that doesn't block code whilst waiting to receive the PID data? Oct 20, 2019
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