Birth control and diarrhea

I took my pill at 9:40 and I had diarrhea at 2:40, and I took another pill at 9am because I was having continuous episodes of diarrhea, am I protected or no? Also I’m in my first week of the pill and I had sex with my boyfriend a day before