Hi all,
I am using for a while both MAX31850 DallasTemp-master and MAX31850 OneWire-master libraries.
Currently I am adding a servo to the pwm output signal from the arduino. I tried out both codes separately and they work just fine, once they work in the same code the servo cant stop still at one position, glitching for some unknown reason.
I am not an expert in coding, but tried to figure out reading the cpp files of this libraries and the only thing that catch my eyes was the use of noInterrupts() and interrupt() functions.
Currently I am using a proximity sensor as an interrupt but Tried to delete that portion of the code and the glitch stays the same.
Can this be because of pin numbers, timers, interrupts?
Anyone with this problem?
For better understanding I post here a link of the exact example I am using. In coding I cancel the waiting for the response signal, as so, I am just cycling around and asking for some new values only if I have receive the a new read. --> Overview | Adafruit 1-Wire Thermocouple Amplifier - MAX31850K | Adafruit Learning System
CODE:
//on setup
sensors.begin();
sensors.getAddress(SPKThermocouple, 0);
sensors.getAddress(EXTThermocouple, 1);
sensors.setResolution(SPKThermocouple, TEMPERATURE_PRECISION);
sensors.setResolution(EXTThermocouple, TEMPERATURE_PRECISION);
sensors.setWaitForConversion(false); // BYPASS SENSORS REFRESH WAIT TIME
if (sensors.isConversionAvailable(0)){
thermoSPK = sensors.getTempC(SPKThermocouple); // READ SPARK TERMOCOUPLE
thermoEXT = sensors.getTempC(EXTThermocouple); // READ EXHAUST TERMOCOUPLE
sensors.requestTemperatures(); // ASK SENSORS TO REFRESH BUT DO NOT WAIT FOR THEM
lastreadtime = nextreadtime;
}