i'm doing a school project but I'm currently stuck with the coding
my project is to make an adapter that will cut the incoming current to your phone and stop its charging when it reaches 100%
Please post your full sketch. If possible you should always post code directly in the forum thread as text using code tags (</> button on the toolbar). This will make it easy for anyone to look at it, which will increase the likelihood of you getting help. If the sketch is longer than the forum will allow then it's ok to add it as an attachment.
Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read.
When your code requires a library that's not included with the Arduino IDE please always post a link(using the chain link icon on the toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger(Sketch > Include Library > Manage Libraries) then say so and state the full name of the library.
Please explain exactly what part of the coding you're stuck on and what the problem is that you're having.
How do you propose getting this code into your phone, and what has it got to do with Arduino?
Phones already have that circuit.