Arduinoでマルチスレッド

protothreadライブラリを使う

http://harteware.blogspot.jp/2010/11/protothread-powerfull-library.html

https://code.google.com/archive/p/arduinode/downloads