User Tools

Site Tools


robotino_hello_world

Hello World on the Robotino

This tutorial details how to create a cpp hello world program directly on the robotino.

Prerequisites

This tutorial assumes you have ccmake installed on your robotino.

You will also need an ssh connection to your robotino.

recommended: complete the Robotino API2 Setup tutorial before attempting this one

Hello World

ssh into your robotino as user robotino (pass: robotino)

go to your home directory by entering

cd

now create a director to store your files

mkdir dasl_tutorials/hello

make it your current directory

cd dasl_tutorials/hello

use vim to create a new file

vim main.cpp

and enter the following code

helloWorldRobotino.cpp
#include <stdio.h>
 
int main() 
{
    printf("hello world.\n");
    return 0;
}

save by entering

<esc> :w

and quit vim

<esc> :q

create another file called CMakeLists.txt with the same method. The body of the file should be:

  cmake_minimum_required(VERSION 2.6)
  project(MyProject)
  add_executable(hello main.cpp)

Note: you may want to change the version to your current version of ccmake

now create your make file by entering

ccmake ./

press 'c' to configure 'c' again then 'g' to generate

now your makefile is create and you can actually compile your program using

make

type

ls

to see the files in the current directory. you should see main.cpp CMakeLists.txt and hello

try to run your program by

./hello

robotino_hello_world.txt · Last modified: 2016/10/25 11:00 by dwallace