refactored arduino sketch, changed temp sensor to digital