How to post code?

Martaine2005

May 12, 2015
5,276
Joined
May 12, 2015
Messages
5,276
I’m sure I’ve seen code posted on here before but I can’t find any way of posting my code.
Is there a code box?. Or am I mistaken and saw it on the arduino forums?.
TIA
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
14,271
Joined
Nov 17, 2011
Messages
14,271
Easy access using the 3-dot button on the menu bar:
1759815931063.png
then:
1759815952649.png
then paste your code into the window:
1759815975866.png
Select language = C-like or C++ for Arduino code.
 

JameStronic

Oct 16, 2025
7
Joined
Oct 16, 2025
Messages
7
Hey Martaine2005,

You can post code here by wrapping it in code tags. Just type
Code:
 before your code and
after it, that will format it properly so it’s easier to read.

For example:

Code:
int main() {
    return 0;
}

That should display it in a clean, readable box once you post.
 
Top