Αποστολή με SMS: Optimal Control of Constrained Piecewise Affine Systems