terminal!

It turns out that having your code output stuff to a terminal is incredibly simple.  The code below will send the strings “str1″ etcetera out to the serial terminal, which is displayed in the little box at the bottom of the Arduino development environment.  Simply press the “serial monitor” button at the top of the ide, and you will see whatever you told the arduino board to print!

/* 
   a terminal printer
   
*/

char* mystr[] = { "str1", "str2", "str3", "str4", "str5", "str6"};

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

void loop() {
  for (int i = 0; i<6; i++) {
    Serial.println(mystr[i]);
    delay(500);
  }
}

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*