Code for Arduino MEGA Flex Communications