So , First rest assured it does work. Second could you edit your post and use the code tags above “</>” and paste it in there, You’ll get better help and it makes it easier to read and test.
Can you post the serial output you get as well? , use a seperate set of code tags.