2019/01/19

Arduino: Hello, World!

This is the first tutorial with Arduino. "Hello World" is usually the very first program to learn a new programming language with a simple command that prints out the "Hello, World!" message.

2. Connect the Arduino board to your computer via a USB cable. Note that in this case the power of the Arduino board is supplied by the 5V USB cable and it is not required to connect to an external DC adapter.

3. In the Arduino IDE window, type the following code:

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.println("Hello world, Arduino!");
}

void loop() {
  // put your main code here, to run repeatedly:
}



3. Select Tools -> your Arduino board such as the popular Arduino Uno.

4. Select Tools -> COM port.

5. Select the upload button and save the project.

6. Select Tools -> Serial monitor.

7. You should see the result if the serial monitor is properly set.

Reference:

Hello World
Arduino: Hello World with blinking LED (StudyEECC)

沒有留言:

張貼留言