refactored code; changed Arduino-part; sending/receiving works via thread