updated arduino code to handle protocol tweaks.