Was flying under the hood with a safety pilot and VFR flight following. ATC tells me to fly a heading of 240 degrees. I fly at the heading for about 3 minutes when ATC comes back and tells me again to fly a 240 heading. I respond that I am, when ATC tells they show me at 270 degrees. Quick look at my 430 shows that my ground track was 270. Needless to say I got all confused. When ATC gives you a heading is that a ground track you are to fly?