Writing Your First "Hello World" Program
This guide will help you write and run your first "Hello World" program using Tiny Basic on the Arduino Due platform. It assumes that Tiny Basic for Arduino is already flashed onto the Arduino Due board.
Step 1: Connect the Arduino Due to Your Computer
-
Use a USB cable to connect the Programming Port (labeled "PROGRAMMING" on the Arduino Due) to your computer. Ensure the cable supports both power and data transfer. The Programming Port is the USB port closest to the DC power jack.
-
Identify the Serial Port:
On Linux, open a terminal and run the following command to list connected devices:
Look for a device like/dev/ttyACM0or/dev/ttyUSB0. This is your Arduino Due's serial port.
Step 2: Access the Serial Interface
-
Open a Serial Terminal. Use a terminal emulator like
Replaceminicom,screen, orpicocom. For example, to usescreen, run:/dev/ttyACM0with the serial port identified earlier. -
Configure the Serial Terminal:
- Set the baud rate to
9600. - Disable hardware flow control if prompted.
- Set the baud rate to
-
Verify the Connection:
- Press
Enterin the terminal. You should see the Tiny Basic prompt (>). - Or, press RESET button in the Arduino Due. You should see the Tiny Basic version details and prompt (
>).
- Press
Step 3: Write the "Hello World" Program
- Enter the Program: Type the following Tiny Basic code into the terminal:
Step 4: Run the Program
-
Execute the Program; at the Tiny Basic prompt, type:
You should see the output: -
Modify or Debug:
-
Use the
LISTcommand to view the program: -
Edit lines by re-entering them with the same line number.
-
Congratulations! You've successfully written and executed your first Tiny Basic program on the Arduino Due.