Porting of Arduino code to modularized version [WP-977]

Jira issue: WP-977