Rough Arduino/RPi code merge

Merge Arduino and RPi code into the same files to simplify development
and maintenance