Skyhawk 172/Cutlass 172
Flight Crew Private
Flight Crew Last 90 Days 20; Flight Crew Total 95; Flight Crew Type 50
Communication Breakdown; Distraction; Situational Awareness
Conflict NMAC; Deviation - Altitude Excursion From Assigned Altitude; Deviation / Discrepancy - Procedural FAR
Air Traffic Control Issued Advisory / Alert; Flight Crew Took Evasive Action
Aircraft; Environment - Non Weather Related; Human Factors
Was flying direct at 7;700 msl with flight following. I was handed off to Center and was assigned a barometric pressure of 30.18; which was in line with my previously assigned pressure. I could see a front off in the distance but didn't consider any pressure change. Center was busy; so my attention was reduced from the radio as most of the radio chatter was for others. Someone came over the radio and stated that they were showing traffic at 7;500 at their same altitude. I can't remember if there was any talk of course or altitude change as my focus went out of the cockpit. A few moments later a high wing Cessna flew over us at 100 ft with a nearly head on course. A few moments later a radio report goes out to me that traffic is 0.25 miles same altitude. I report back that he is too late. The other aircraft states that he saw us on the ADSB and was climbing prior to our close call to avoid. He also requests a number to file a complaint with FSS. I'm asked to check my altitude and I tell him I'm at 7;700 and my pressure is 30.18. I'm told that the controller had me at 7;500 and that I should have been given a pressure of 30.11 which put me at a physically higher altitude.Since I was flying into a front I should have known that the pressure would be changing and that I should be adjusting more frequently. Since the last time I got a pressure setting was when I entered Approach airspace and the Center's pressure was the same I reported my altitude lower than I physically was. I have Foreflight and a stratus so I could have been more proactive with adjusting my pressure as well as seeing my GPS altitude for comparison. I also realize now that flight following is not a flight plan or a VFR version of an IFR plan and that it gets low priority to all other traffic.
C172 pilot reported an incorrectly set altimeter led to a near mid air collision.