Ex help

I recently told my ex, through a letter, that I think it's best if we stop communicating and hanging out since I am having trouble mo IMG on from the break up and being happy (he broke up with me). But of course I have 0 will power and texted him once after he came into my place of work (where he was fired) just to make sure he was okay since that was kind of odd, and I've snapchatted him twice as well within the past two weeks. I really do want to be able to be his friend again in the future, hr admitted to still having feelings for me, but now I feel like I've messed up by initiating no contact and not even being able to maintain it. Any thoughts/advice?