Apple pencil stopped working even when connected
I have had my 10.5-inch 2017 iPad Pro for four years. I have had my Apple Pencil 1 for about 8 months. It has always worked perfectly up until a couple of days ago. It shows that it is connected to bluetooth and that it has a full charge, but nothing happens when I use it on the screen. When the problem first started, pushing the sleep button and then waking up my iPad again seemed to help, but now, that doesn't seem to be working anymore. It will occasionally start writing again for a couple seconds before it stops working again. I have tried forgetting and repairing the pencil, rebooting my iPad, and updating my iPad's software; nothing works. I am a student and really need my pencil so I'm hoping someone can help. Thank you!
iPad Pro 10.5-inch, Wi-Fi