The display works fine, along with all the code for it,
the touchscreen is separate and is the 4 wire resistive type
I trid the delay before and after the one wire code thinking that since that's what's causing it I should isolate it it, it seems to only be the actuall communication, becajse if no sensors are on the line its fine
Edit
Here is involved code, the ehole code is 30kb
p = ts.getPoint(); // touch reading code that fails the first powerup, part of main loop
if (p.z > MINPRESSURE && p.z < MAXPRESSURE) { //touch reading refinement
p.x = map(p.x, TS_MINX, TS_MAXX, tft.width(), 0); // x reading
p.y = map(p.y, TS_MINY, TS_MAXY, tft.height(), 0);// y reading
if(brightness = 1){
screentimer = time;
brightness = 0;
digitalWrite(LCD_BRIGHTNESS, brightness);
}
}
sensors.begin(); // part in setup, and the root of all evil, but only the first time assuming a device is on the line
sensors.setResolution(insideThermometer, TEMPERATURE_PRECISION);
sensors.setResolution(outsideThermometer, TEMPERATURE_PRECISION);
temp1 = sensors.getResolution(insideThermometer);
temp2 = sensors.getResolution(outsideThermometer);
if(temp1 !=9){ // these dont cause it, i added afterwards
tft.println("TEMP1 BAD");
}
if(temp1 == 9){
tft.println("TEMP1 GOOD");
temp1 = 1;
}
if(temp2 !=9){
tft.println("TEMP2 BAD");
}
if(temp2 == 9){
tft.println("TEMP2 GOOD");
temp2 = 1;
}
oneWire.reset(); // tried with and without this thought maybe it was hanging
// sensor read code in main loop
if(time - sensorreadtimer > sensreaddelay){
sensorreadtimer = time;
temperature1 = 0;
temperature2 = 0;
sensors.requestTemperatures();
if(temp1 == 1){
temperature1 = sensors.getTempC(insideThermometer);
temperature1 = DallasTemperature::toFahrenheit(temperature1);
}
if(temp2 == 1){
temperature2 = sensors.getTempC(outsideThermometer);
temperature2 = DallasTemperature::toFahrenheit(temperature2);
}
analogRead(A13);
rawvoltage = vref * analogRead(A13); //voltage sensor
rawvoltage = rawvoltage / 1024; // to mv
rawvoltage = rawvoltage * 6.5767; // times the voltage divider constant
batteryvoltage = rawvoltage; // to actual voltage sensed
analogRead(A12);
rawcurrent = vref * analogRead(A12); // conv to mv, not finished
rawcurrent = rawcurrent / 1024;
rawcurrent = rawcurrent - 2.5; ratiometric
rawcurrent = abs(rawcurrent);
batterycurrent = rawcurrent;
}