Code update and fixes

• fixed arduino detection
• set variables attributes for multithreading (see multithreading
branch)