Pages: [1]   Go Down
Author Topic: test to look at copy-paste with code tags, copy for forum, and copy for html  (Read 629 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27089
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
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>
« Last Edit: July 26, 2013, 01:22:24 am by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13707
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

[ code=Arduino]
or
[ code=Processing]

Code: (Processing)
void setup(){
  Serial.begin(9600);
}
void loop(){
  if (Serial.available()){
    delay(500);
    Serial.print(Serial.read());
  }
}
but no syntax HL yet
Logged

Rob Tillaart

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

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13707
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

a variation ...

Code: (c) Rob ;)
void setup()
{
  Serial.begin(9600);
}

...
Logged

Rob Tillaart

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

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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/
Logged

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

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27089
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Make sure it knows you're pasting HTML and not text.
Logged

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

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27089
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13707
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

- 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 smiley-sad

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

Logged

Rob Tillaart

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

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 
Logged

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

Pages: [1]   Go Up
Jump to: