Skip to content

Commit 1b47ca3

Browse files
committed
add converting .ino to .cpp as a tip
1 parent 43cf758 commit 1b47ca3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

docs/vscode/migrating.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,17 @@ Depending on the complexity of your project, adding the source should be quite s
4545
4646
```
4747

48-
In this case you would replace the contents of `/src/main.cpp` with the contents of the '.ino' file from the project you downloaded (it's often easier to delete the `main.cpp` file, copy in your `.ino` file and then rename it to `main.cpp`).
48+
In this case you would delete the `/src/main.cpp` and replace it with the '.ino' file from the project you downloaded.
4949

50+
:::tip
51+
52+
PlatformIO encourages the use of standard C++ files (`.cpp`). To convert your `.ino` file, you can rename it and change the extension to '.cpp', but you will also need to add a line to include the standard Arduino headers at the beginning of the file:
53+
```
54+
#include <Arduino.h>
55+
```
56+
Any user functions should also be declared before they are called. There is a more detailed example of this in the [PlatformIO documentation FAQ](https://docs.platformio.org/en/latest/faq/ino-to-cpp.html).
57+
58+
:::
5059

5160
## Verify/add libraries
5261

0 commit comments

Comments
 (0)