My son and I are trying to work write a program, in Python, that takes repeated readings (within a loop) from our DI thermal infrared sensor and also from our EV3 gyro. We’ve adapted the sensor examples from the github so that, on their own, each works within the loop that we want. However, we can’t get them both to work within the same program.
One of two things happens. If, before calling result = BrickPiUpdateValues() for the Gyro, we do not include the line BrickPiSetupSensors(), we get an error message when we try to run, pointing to this line. If we do NOT include this line, then we can run without an error message, but the Gyro returns an invariant result of 0.
The DI-dtIR code contains stuff at the beginning which we don’t quite understand. My guess is that this sets up the bus for the sensors in a way that is incompatible with what the EV3 sensors needs. Is this correct? And if so, is there a way to get these two sensors working together smoothly? I guess as a worst case we could spring for an EV3 IR sensor, since the sensor example for that looks a lot simpler! But we were hoping to use the DI one, which we’ve already got!
Any help/advice would be appreciated!