Difference between revisions of "Hello World!"

From SainSmart Wiki
Jump to: navigation, search
(Created page with "In this chapter, we will learn use Arduino IDE serial interface tools to show the contents that we want to display in the computer. === Example code: === void setup() { ...")
 
 
Line 21: Line 21:
  
 
2) After download, click “tool”, pick up relevant arduino board, and relevant com. Then click “serial Monitor”, on the new open up window’s bottom right, choose the relevant rate.
 
2) After download, click “tool”, pick up relevant arduino board, and relevant com. Then click “serial Monitor”, on the new open up window’s bottom right, choose the relevant rate.
 +
 +
[[File:c1.jpg]]

Latest revision as of 07:01, 14 June 2013

In this chapter, we will learn use Arduino IDE serial interface tools to show the contents that we want to display in the computer.

Example code:

void setup()
{
   Serial.begin(9600);// opens serial port, sets data rate to 9600 bps
 Serial.println("Hello World!");
}
void loop()
{
}

Explain:

Serial.begin(9600); The comment says 9600 bps, and just so you know bps stands for bits-per-second (we will refer to this as the baud rate). Communicate with computer, you may choose these rate “300, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, 115200”.

Operation:

1) Download code to arduino.

2) After download, click “tool”, pick up relevant arduino board, and relevant com. Then click “serial Monitor”, on the new open up window’s bottom right, choose the relevant rate.

C1.jpg