Raspberry pi to arduino communication code

works with 9600 baud rate.