added basic attachInterrupt method and thread