Forum Tips and Tricks

Formatting your Code Examples is Easy

Here is a quick tip that makes your posted code look beautiful.

// The following two line is for Local Builds, 
// but works fine in the Sparkulator (web IDE)
#include "application.h"

void setup() {
  pinMode(D7,OUTPUT);
}

void loop() {
  // Blinky code
  digitalWrite(D7,HIGH);
  delay(100);
  digitalWrite(D7,LOW);
  delay(100);
}

Here's what my post looks like edited:


All you have to do is wrap your code in

```cpp

// my code
if(worldRuler == "ME") {
play(VICTORY_SONG);
}

```

and it will look like this:

// my code
if(worldRuler == "ME") {
  play(VICTORY_SONG);
}

Make sure the

```cpp

and

```

are on their own lines!


Some further discussion about the language hints (e.g. cpp, java, ...) can be found in this thread

9 Likes