Thanks for pointing that out. You can avoid the manual operations with some additional functions.
The following will create a file and open it using the Arduino IDE.
dir = CreateDirectory[FileNameJoin[{$HomeDirectory, "Demo"}]];
MicrocontrollerEmbedCode[
NonlinearStateSpaceModel[{{Which[x > 0, 0, True, 1]}, {x}}, {x}, {}, {Automatic}, Automatic, SamplingPeriod -> 2],
<|"Target" -> "ArduinoUno", "Outputs" -> 13 -> "Digital"|>,
<|"ConnectionPort" -> "p"|>,
<|"Language" -> "Wiring", "WorkingDirectory" -> dir, "CleanIntermediate" -> False, "CreateBinary" -> False|>];
SystemOpen[RenameFile[FileNameJoin[{dir, "Demo.cpp"}], FileNameJoin[{dir, "Demo.ino"}]]]
This could be customized to handle repeated evaluations, etc.
Your mileage will vary with this approach because, for example, if we are trying to leapfrog to a Mega from a Uno there is no pin A12 on the latter.
However, the Mega is supported in 12.1. The official announcement will come, along with a whole bunch of other Arduino boards, in 12.2.