Hello [Arduino ATmega2560]


This example contains the bare minimum of code you need for an Arduino project to compile. Also its uses Serial object from core Arduino library to prints "hello world" to serial console (UART1 port).

Code

 

Project includes single file Hello.ino which contains 2 functions: setup()

and loop().

 

Function setup() is called once when a firmware starts. It configures serial port UART1 as 115200, 8N1. Also it use Serial object from Arduino core library to print "Hello World!" string to serial port.

 

Second function which should be declared is loop(). In Hello example this function does nothing. It will be called from Arduino library inside forever loop consecutively. Here can be placed code which will control MINI-MAX/AVR-C board.

Toolkit:AVR Development System

Location:\bipom\devtools\Arduino\ATmega2560\Examples\Hello\

Photos


Power adapter and serial cable connected to MINI-MAX/AVR-C Board Power adapter and serial cable connected to MINI-MAX/AVR-C Board
Terminal window in Micro-IDE when Hello example is running Terminal window in Micro-IDE when Hello example is running

Code Example


void setup() 
{ 
  Serial.begin(115200); 

  // prints string with ending line break 

  Serial.println("Hello World!"); 
} 


void loop() 
{ 
}