The pin numbers that you’re using here are GPIO numbers, They aren’t the same as the D numbers printed next to the pins on your Wemos D1 Mini.
If you take a look at this:
You’ll see that it says that GPIO 6-11 are reserved, and shouldn’t be used (there are no pins connected to them anyway).
Edited to add…
I’ve just re-read this and I’m now not clear what type of board you’re using. You tagged your post onto a thread about a NodeMCU board, and you’ve said that you’re using a Wemos D1. If that’s a D1 Mini then what IO’ve said above is correct.
If it’s one of those Arduino sized boards known as a D1 R1 then none of my comments are relevant.
Either way, I’ve split this to its own topic, as I’m not sure that the two issues are related.
Pete.