Started birth control a day before my period.

Am I still going to be protected if I started my birth control a day before my period is predicted to start? I just got it today for my irregular periods and my doctor told me to start immediately but I didn’t mention that I’m a day before my period.