Posting source code on wordpress.com [sourcecode language="css"] [/sourcecode]


While WordPress.com doesn’t allow you to use potentially dangerous code on your blog, there is a way to post source code for viewing. We have created a shortcode you can wrap around source code that preserves its formatting like the code below. Notice the shortcode goes in square brackets not angle brackets, and the code language must be specified if you want highlighting.
Full details here:- http://en.support.wordpress.com/code/posting-source-code/


/* Example 31.1 - Arduino internal EEPROM demonstration
http://tronixstuff.com/tutorials > chapter 31 | CC by-sa-nc */
#include 
int zz;
int EEsize = 1024; // size in bytes of your board's EEPROM
void setup()
{
  Serial.begin(9600);
  randomSeed(analogRead(0));
}
void loop()
{
 
  Serial.println();
  for (int a=0; a<EEsize; a++)
  {
    zz = EEPROM.read(a);
    Serial.print("EEPROM position: ");
    Serial.print(a);
    Serial.print(" contains ");
    Serial.println(zz);
    delay(25);
  }
}
Advertisements
This entry was posted in Wordpress. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s