I miss my ex.

We dated for about a month last year and I hated him after we broke up, but now since school started back up and I have to classes with him, I really miss him.. We say hi to eachother once in awhile but we don't really talk
Any advice as to what I could do ?