How do I connect Arduino to unity ?

I am using Unity 2018.3.11f1 version. I saw a bunch of tutorials on Youtube all those tutorials use “using System.IO.Ports” for Arduino scripts. But it doesn’t work on the current version I have.

I tried searching an alternative to it by looking up the asset store even the asset store has assets with obsolete code. The Uniduino asset doesn’t exist anymore on the asset store.

The only solution I found to this problem was changing my player’s API compatibility to .NET 2.0.

Well that didn’t work out at all.

Are Arduinos are still compatible with Unity? Is there an alternative to using System.IO.Ports?

I found the answer Thanks to @xxmariofer
Link to the answer:

“you need to set api compatibility level to net 4.x(tested with 2018.3.0f2 version)”