Using MMA8451 accelerometer to count steps
Change your if statement - remove ; (semicolon) from the end.

Use this:

if (event.acceleration.x &gt;= 5)
accum = accum + 1;


Notice there is no semicolon after if statement