Trying to use Tap Detection solution using ADXL345 with Arduino
the arrays are indexed from 0 but you assign to TAP_ variables array values indexed 1,2,3.

Are you sure the sensor is wired ok? Did it work with a library example?