void setup()
{
Serial.begin(9600); //begin using serial communication
}
void loop()
{
Serial.print("Hello World"); //print text without a new line
int favoriteNumber=7; //declare variable
Serial.println(favoriteNumber); //print values or numbers with a new line each time
}
Challenge: Edit this code to print your own message to the screen!
void setup()
{
Serial.begin(9600); //begin using serial communication
}
void loop()
{
int l = 10; //declare a variable called l and give it the value 10
int w = 6; //declare a variable called w and give it the value 6
int area = l * w; //declare a variable called area and equate it to l times w
Serial.print("The area is ");
Serial.println(area); //print the value of area
}
Challenge: Edit this code to calculate something else. For example you could calculate volume, which is length*width*height.