In this paper we consider the bifurcation of nonhyperbolic limit cycles in a class of piecewise smooth planar systems with two zones. We assume that the unperturbed system has a nonhyperbolic limit cycle that crosses every switching line transversally exactly once. By using the Diliberto theorem and variation lemma we derive the Poincare map. Then we discuss the stability and bifurcation of the limit cycle.