Birth control question

Destinie
I just started birth control this month with the beginning on my period. The internet says birth control only takes a week to come into effect but my fertile window is coming up. If I had unprotected sex would the pill work?