My question involves criminal law for the state of: Michigan.

Hello. I am a 20 year old resident of southeast Michigan. On August 3, 2009, my girlfriend and I were leaving a local arcade at approximately 1am. Having been in the car for no more than a minute, we started to pull out of the parking spot. That's when we saw police lights. We had done nothing wrong, we were just trying to leave the premises. The officer asked immediately if we were doing anything we weren't supposed to. We told him no. He said that the parking lot is a common place for young people to hang out and smoke marijuana. He informed us that if we were smoking pot and lying about it, we would both go to jail.
I did happen to have around three grams of marijuana tucked away in my backpack in the back seat. However, we weren't smoking any of it before being pulled over, nor were we smoking at all that day. After presenting my license and proof of insurance to the cop, he said that I looked very nervous and told me to step out of the car. He didn't ask if he could search the vehicle, but I feared that he would anyway. So while stepping out of my car, I came clean about the pot in the back seat.
He then searched my person, my vehicle and my girlfriend’s purse while we sat in the back of the squad car. Having found no other illicit substances other than the pot I admitted to having, he issued me a ticket for possession of marijuana and said that although my car and my girlfriend’s purse were trashed, I was lucky not to go to jail.
My question is, were any of my rights violated? More importantly, I would like to know what to expect when I go to court. I am 20 years old and have no arrest record whatsoever. I haven’t been through any phase of the criminal justice system… I have a clean slate so-to-speak. What punishment do they usually administer to first time offenders? Remember, this was a small amount for personal use. Thank you for your time and expertise.

--- Scared in Michigan