First we examine a resonant variational inequality driven by the $p$ -Laplacian and with a nonsmooth potential. We prove the existence of a nontrivial solution. Then we use this existence theorem to obtain nontrivial positive solutions for a class of resonant elliptic equations involving the $p$ -Laplacian and a nonsmooth potential. Our approach is variational based on the nonsmooth critical point theory for functionals of the form $\varphi=\varphi_1+\varphi_2$ with $\varphi_1$ locally Lipschitz and $\varphi_2$ proper, convex, lower semicontinuous.