possible to #include header files ?

HomeForumsMonoBrick EV3 Firmwarepossible to #include header files ?

This topic contains 2 replies, has 2 voices, and was last updated by Author Image Helmut Wunder 5 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #4261
    Author Image
    Helmut Wunder

    is it possible by Mono / C# to #include header files (e.g., #include “MonoDefs.h”)?

    Having his one could pre-define in here:

    // filename: "MonoDefs.h"
        using System;
        using MonoBrickFirmware;
        using MonoBrickFirmware.Movement;
        using MonoBrickFirmware.Sensors;
        using MonoBrickFirmware.Display;
        using System.Threading;
        using System.Reflection;
        using System.Resources;
        void init() {
          Motor m01 = new Motor(MotorPort.OutA);
          Motor m02 = new Motor(MotorPort.OutB);
          Motor m03 = new Motor(MotorPort.OutC);
          Motor m04 = new Motor(MotorPort.OutD);
          Lcd lcd1 = new Lcd();

    and in the main program by

    #include "MonoDefs.h"

    everything would have been initialized

    Author Image
    Anders Søborg
    Key Master

    Not to my knowledge… remember that these are namespaces not files


    Author Image
    Helmut Wunder

    thank you, now I understand!

    was known to me as a PASCAL statement which includes unit files and which worked similar like
    for (e.g., header) files in plain C
    so I confused this C# command
    by the aforementioned.

    the other issue now is resolved, too – it wouldn’t work because inside an init procedure the instance variables woud be just local and not global and thus useless for their intended purpose.

    But now it’s clear, thanks again! 8-)

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Posted in

Make a donation