digitalWrite doesnot work with tinyFat

Hello i made a program to control lights and a pump.
with a touchscreen 3.2 ili9341 and a tft shield v2.2 on a mega.
it grafish asspect works fine.
But my digitalWrite doesnot .
to find out what is the problem i started from scrath with the example program buttons.
now i found the problem but dont now how to solve it.

if i use file.initFAT(); it wont work .
if i block it //file.initFAT(); it works

how comes ?
what can i do about it ?
i want to use digitalports 8,9,10,11,12,13

i will attach my program as well

Thanks in advange

Button2.ino (2.26 KB)

zwembad_klaas.ino (38.5 KB)

Pins 10, 11, 12 and 13 are also the SPI pins. Once you use SPI, 11, 12 and 13 can't be used for anything else. Pin 10 can still be used as output.

Find other pins for your LEDs.

Thanks for your answer sterretje.
stil 8,9,10 dont work
i try to change them in 24,25,26
dont work properly
first all 3 on if i tough the mega 24,26 go off then it works but if i start it again i have to slightly touch it again.

No idea; but I think you have written yourself a recipe for problems.

loop() calls timetemp() which calls alarmtime() which calls loop() again. This is recursive calling of a function and with limited memory it will cause problems. I suspect that the conditions in alarmtime() prevent you from noticing it straight away. You have other functions that call loop() as well.

You will have to go back to the drawing board and redesign your software. And while doing so, get rid of the labels and goto statements.