Updated for multi-platform (but only runs on rpi)