Scala Programs for IoT