{"id":3734,"date":"2019-09-10T17:36:19","date_gmt":"2019-09-10T21:36:19","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2021\/work\/?p=3734"},"modified":"2020-10-25T19:22:55","modified_gmt":"2020-10-25T23:22:55","slug":"code-posting-examples","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2021\/work\/2019\/09\/10\/code-posting-examples\/","title":{"rendered":"Code Posting Examples"},"content":{"rendered":"\n<p>The preferred mode for posting Arduino code is to use a SyntaxHighlighter Code block type, setting the &#8220;Code Language&#8221; to &#8220;C \/ C++&#8221; in the properties (on the right).  That way the code can be cut and pasted, has line numbers, and colored keywords for legibility.<\/p>\n\n\n\n<h2>SyntaxHighlighter Code Block<\/h2>\n\n\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\nvoid setup(void)\n{\n   Serial.begin(9600);\n}\nvoid loop(void)\n{\n   Serial.println(&quot;Hello, world.&quot;);\n}\n\n\n\n<\/pre>\n\n\n<h2>Plain &#8220;Code&#8221; Block Sample<\/h2>\n\n\n\n<p>The default &#8220;Code&#8221; block style isn&#8217;t very readable with this site template, see below.  Please avoid this style.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>void setup(void)\n{\n   Serial.begin(9600);\n}\nvoid loop(void)\n{\n   Serial.println(\"Hello, world.\");\n}\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The preferred mode for posting Arduino code is to use a SyntaxHighlighter Code block type, setting the &#8220;Code Language&#8221; to &#8220;C \/ C++&#8221; in the properties (on the&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2021\/work\/wp-json\/wp\/v2\/posts\/3734"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2021\/work\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2021\/work\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2021\/work\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2021\/work\/wp-json\/wp\/v2\/comments?post=3734"}],"version-history":[{"count":3,"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2021\/work\/wp-json\/wp\/v2\/posts\/3734\/revisions"}],"predecessor-version":[{"id":4494,"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2021\/work\/wp-json\/wp\/v2\/posts\/3734\/revisions\/4494"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2021\/work\/wp-json\/wp\/v2\/media?parent=3734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2021\/work\/wp-json\/wp\/v2\/categories?post=3734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2021\/work\/wp-json\/wp\/v2\/tags?post=3734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}