Go Down

Topic: test to look at copy-paste with code tags, copy for forum, and copy for html (Read 695 times) previous topic - next topic

CrossRoads

Code: [Select]
void setup(){
 Serial.begin(9600);
}
void loop(){
 if (Serial.available()){
   delay(500);
   Serial.print(Serial.read());
 }
}

Huh - either can be highlighted & copied into the Arduino IDE - the color and bold tags seem to be ignored. Not sure what other editors/IDEs might do.
Quote

void setup(){
 Serial.begin(9600);
}
void loop(){
 if (Serial.available()){
   delay(500);
   Serial.print(Serial.read());
 }
}



Not this mess tho - not sure what'd it be useful for.

<pre>
<span style="color: #CC6600;">void</span> <span style="color: #CC6600;"><b>setup</b></span>(){
&nbsp;&nbsp;<span style="color: #CC6600;"><b>Serial</b></span>.<span style="color: #CC6600;">begin</span>(9600);
}
<span style="color: #CC6600;">void</span> <span style="color: #CC6600;"><b>loop</b></span>(){
&nbsp;&nbsp;<span style="color: #CC6600;">if</span> (<span style="color: #CC6600;"><b>Serial</b></span>.<span style="color: #CC6600;">available</span>()){
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #CC6600;">delay</span>(500);
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #CC6600;"><b>Serial</b></span>.<span style="color: #CC6600;">print</span>(<span style="color: #CC6600;"><b>Serial</b></span>.<span style="color: #CC6600;">read</span>());
&nbsp;&nbsp;}
}

</pre>
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

robtillaart

you can do this
Code: (Arduino) [Select]
void setup(){
 Serial.begin(9600);
}
void loop(){
 if (Serial.available()){
   delay(500);
   Serial.print(Serial.read());
 }
}


[ code=Arduino]
or
[ code=Processing]

Code: (Processing) [Select]
void setup(){
 Serial.begin(9600);
}
void loop(){
 if (Serial.available()){
   delay(500);
   Serial.print(Serial.read());
 }
}

but no syntax HL yet
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

robtillaart

a variation ...

Code: (c) Rob ;) [Select]

void setup()
{
  Serial.begin(9600);
}

...
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

James C4S


Not this mess tho - not sure what'd it be useful for.

Makes it easy to paste into HTML:
http://www.baldengineer.com/projects/arduino-copypaste-test/
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

CrossRoads

Thanks for the comments.  Can do interesting things with the code tags.
I tried pasting HTML into Nvu, which is a web page editor, and did't see that it did anything useful when I previewed the page.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

James C4S

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

CrossRoads

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

robtillaart

- http://docs.simplemachines.org/index.php?topic=735 - explains all tags with examples

e.g. if you use [ php] you can get (PHP) syntax highlighting !  - as PHP and C++ are close enough it is almost useful.
drawback - it does not create the scrollbar :(


void setup
()
{
  
Serial.begin(9600);  // adjust baudrate as needed 
}


Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

James C4S


With paste special, or similar? I'll try that. Thanks.

I don't know how Nvu works.

In my wordpress example I pasted the code into the text editor and then in the html editor. 
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Go Up