We needed to create a code for our project assignment. A smart parking system. I created my code as below, but I get the "Invalid header file" error. What should I do. Thank you for your help.
This is the second time today that I have seen this error reported from TinkerCAD without details being available, hence no resolution was possible in the other case
If all you get from TinkerCAD is "Invalid header file" then there is not much that can be given
The code also contains several errors such as mis-spelling the names of the the setCursor() and pulseIn() functions that would prevent the code from compiling
A "Invalid header file" error can have many causes, and without the header filename (or, better, the complete error message and where it came out from) we can say nothing to help you. This is like going to a car mechanic saying "Hey, my car makes a bad noise": don't you expect to be given a specific answer to such a general question?
If you tried to run your code on Tinkercad please share here the project link so we can directly see what's wrong and why.
Taking what you said into consideration, I made some edits and ran it on the IDE. This is the current version of the code. I am also sharing with you the error I received on the IDE.
I tested your code on Tinkercad, and commenting out the wire.h include, that error won't come out (obviously others came out due to the lack of Wire library) , so I suppose something bad is with Tinkercad Wire library.
Let me say I switched to Wokwi months ago, and I still find it much more useful and a better usage than Tinkercad: it's easier to make good looking drawings, automatic wires coloring when starting a GND or 5V wire, destination pin automatic enhanced to show where that specific wire can be natively connected (e.g. starting a GND connection, the GND pin on other devices are shown in white), and "custom devices" definitions, to name just the first things that come to mind.
I tried it on Wokwi and it doesn't show that header error at all, except for some other errors that must be corrected, like a "SetCursor()" method instead of "setCursor()", "pulseIN()" instead of "pulseIn()", and so on, and you have (at least) a missing bracket at the end of the code (the "loop()" is incomplete).
On top of that, you have a very bad indentation (maybe causing also the missing bracket), please don't write "casual" coding, load your sketch with the IDE and press Ctrl-T to make the code correctly indented.
So after reformatting the code, I strongly suggest you to switch to Wokwi instead of Tinkercad.
Thank you for your suggestions and help. I was able to recompile the code as follows and make the necessary connections and run it. Thank you again to those who helped.