user1328: I'm having a problem. I want to clear the screen on the connected console. And after the clear, I want to rerun my code. But I can't seem to figure out how to do it. Below is some part of the code: 
#include <motorStyring.h>
#include <Bridge.h>
#include <YunServer.h>
#include <YunClient.h>
#define PORT 6666
motorStyring mt;
int cm;

  YunServer server(PORT);
  const int pingPin = 9;
  int led = 13;
    void setup() {

    Serial.begin(115200);
    Bridge.begin();
    server.noListenOnLocalhost();
    server.begin();
 }
    void loop() {
    long duration, inches, cm;
    pinMode(pingPin,OUTPUT);
    digitalWrite(pingPin,LOW);
    delayMicroseconds(2);
    digitalWrite(pingPin, HIGH);
    delayMicroseconds(5);
    digitalWrite(pingPin,LOW);
    pinMode(pingPin, INPUT);
    duration = pulseIn(pingPin,HIGH);
    cm = microsecondsToCentimeters(duration);
    h();
   }
    void h()
   {
    YunClient client = server.accept();
     if (client.connected()) {
      String question = "What would you like to drink?\nyou have 4    choises:\n1)Juice\n2)Vodca\n3)Soda\n4)Mix\n";
client.write((uint8_t*)&question[0], question.length());    
String response;
while (client.connected()) {
  if (client.available()) {
    char cmd = client.read();
    if (cmd == '\n') {
      break;
    } else {
      response += String(cmd);
    }
  }
}
if (response == "juice") {
  juice();

} else if (response == "vodka") {
  vodka();

} else if (response == "soda") {
  soda();

} else if (response == "mix") {
  mix();

} else {

  String error = "you didn't select anything that corrospond to an option. \n try agin";
  client.write((uint8_t*)&error[0], error.length());
 }
   String awnser = "Here is your " + response;
   client.write((uint8_t*)&awnser[0], awnser.length());
 }
 delay(1000);
}

...
Is there a way to clear the screen on the console, so that all of the text from the previous code is not disturbing the user?

user8: Perhaps you could count the number of lines in the console and the print out enough carriage returns ("\n") to fill it with empty whitespace.
For example, with a console with 100 lines:
for(int iter = 0; iter < 100; iter++) {
   client.write('\n');
}


1328: <p>I'm having a problem. I want to clear the screen on the connected console. And after the clear, I want to rerun my code. But I can't seem to figure out how to do it. Below is some part of the code: </p>

<pre><code>#include &lt;motorStyring.h&gt;
#include &lt;Bridge.h&gt;
#include &lt;YunServer.h&gt;
#include &lt;YunClient.h&gt;
#define PORT 6666
motorStyring mt;
int cm;

  YunServer server(PORT);
  const int pingPin = 9;
  int led = 13;
    void setup() {

    Serial.begin(115200);
    Bridge.begin();
    server.noListenOnLocalhost();
    server.begin();
 }
    void loop() {
    long duration, inches, cm;
    pinMode(pingPin,OUTPUT);
    digitalWrite(pingPin,LOW);
    delayMicroseconds(2);
    digitalWrite(pingPin, HIGH);
    delayMicroseconds(5);
    digitalWrite(pingPin,LOW);
    pinMode(pingPin, INPUT);
    duration = pulseIn(pingPin,HIGH);
    cm = microsecondsToCentimeters(duration);
    h();
   }
    void h()
   {
    YunClient client = server.accept();
     if (client.connected()) {
      String question = "What would you like to drink?\nyou have 4    choises:\n1)Juice\n2)Vodca\n3)Soda\n4)Mix\n";
client.write((uint8_t*)&amp;question[0], question.length());    
String response;
while (client.connected()) {
  if (client.available()) {
    char cmd = client.read();
    if (cmd == '\n') {
      break;
    } else {
      response += String(cmd);
    }
  }
}
if (response == "juice") {
  juice();

} else if (response == "vodka") {
  vodka();

} else if (response == "soda") {
  soda();

} else if (response == "mix") {
  mix();

} else {

  String error = "you didn't select anything that corrospond to an option. \n try agin";
  client.write((uint8_t*)&amp;error[0], error.length());
 }
   String awnser = "Here is your " + response;
   client.write((uint8_t*)&amp;awnser[0], awnser.length());
 }
 delay(1000);
}
</code></pre>

<p><strong>...</strong></p>

<p>Is there a way to clear the screen on the console, so that all of the text from the previous code is not disturbing the user?</p>
 8: <p>Perhaps you could count the number of lines in the console and the print out enough carriage returns (<code>"\n"</code>) to fill it with empty whitespace.</p>

<p>For example, with a console with 100 lines:</p>

<pre><code>for(int iter = 0; iter &lt; 100; iter++) {
   client.write('\n');
}
</code></pre>
