Yeah, I should've been clearer.

Definitely you have to talk to the cop.

But you DON'T have to tell them what you think you did wrong. (Your fright-addled initial impression is probably wrong, anyhow.) If the cop asks you what you did wrong, tell them you're shook up and you need to think about it when your mind is clearer. If they don't ask you, DEFINITELY don't volunteer it.