6.3.3 user_code.cpp file
Example cpp file.
#include "user_code.h"
// TODO: add your variable definitions here
void
user_code::Task(
void
* pContext __attribute__((unused)))
{
// TODO: replace this with your own code
virtualDisplay::Lock();
virtualDisplay::ClearLine(0);
virtualDisplay::WriteString(0,
"Hello
␣
Marvin!"
);
virtualDisplay::Unlock();
// Tasks must not return!
vTaskSuspend(0);
}
// TODO: add your function definitions here
6.4 iRP extract of the C++ code
It is also possible to extract and copy C++ code from the iRP domain into this task.
Example:
• Connect Marvin and start iRP in your browser.
• Load the iRP program “ClockWithSound” from the SD-Card.
• In the iRP WebIDE go to “Show source code” - default is “C++ view” and store the source code by
clicking on the “Disk Symbol”.
• Then go to “h++ view” by clicking on the symbol and store the h++ code by clicking on the “Disk
Symbol”.
• Store the content of the “IRP_program.h and IRP_program.cpp” file into the “user_code.h and
user_code.cpp” files and compile the programm.
AREXX Engineering & JM³ Engineering
Version: 1.3.1
October 27, 2017
Page: 50