GNUBLIN embedded GNU/Linux
http://forum.gnublin.org/

Mono Csharp with Gnublin modules
http://forum.gnublin.org/viewtopic.php?f=10&t=318
Seite 1 von 1

Autor:  micclfr [ Mi 31. Jul 2013, 19:05 ]
Betreff des Beitrags:  Mono Csharp with Gnublin modules

I used SWIG 2.0 :

sudo apt-get install swig2.0

which builds a native wrapper around the C++ code and exposes Csharp classes.

• swig2.0 -csharp -c++ -module libgnublin_wrap gnublin.i

And then you get a full blown api for a lot of modules, and code for using i2c, Spi, Gpio, Pwm and prbuilt modules.

An example :

Code:

       static void Main(string[] args)

       {

           gnublin_module_relay relay = new gnublin_module_relay();

           relay.setAddress(0x20);

           gnublin_gpio gpio = new gnublin_gpio();

           SWIGTYPE_p_std__string output = libgnublin_wrap.numberToString(libgnublin_wrap.OUT);

           gpio.pinMode(3, output);

           gpio.digitalwrite(3,1);

           while (true)

           {

               for (int i = 1; i <= 8; i++)

               {

                   relay.switchPin(i, 1);

                   Thread.Sleep(100);

               }

               for (int i = 1; i <= 8; i++)

               {

                   relay.switchPin(i, 0);

                   Thread.Sleep(100);

               }

           }



you just get to use that somewhat ugly construction (could easilybe hidden !) to initialize a Gpio pin :

SWIGTYPE_p_std__string output = libgnublin_wrap.numberToString(libgnublin_wrap.OUT);

It is easy then to build a plugin for Homeseer 3 on the Raspberry Pi

micclfr

Autor:  sauterbe [ Fr 9. Aug 2013, 17:44 ]
Betreff des Beitrags:  Re: Mono Csharp with Gnublin modules

sounds interesting

Autor:  hnoor0011 [ Do 10. Dez 2015, 15:27 ]
Betreff des Beitrags:  Re: Mono Csharp with Gnublin modules

you just get to use that somewhat ugly construction (could easilybe hidden !) to initialize a Gpio pin :

SWIGTYPE_p_std__string output = libgnublin_wrap.numberToString(libgnublin_wrap.OUT);

Autor:  najatuw4646 [ Sa 6. Aug 2016, 05:59 ]
Betreff des Beitrags:  Re: Mono Csharp with Gnublin modules

which builds a native wrapper around the C++ code and exposes Csharp classes.
royal1688 casino

Autor:  tomcruzz [ Mo 6. Feb 2017, 10:22 ]
Betreff des Beitrags:  Re: Mono Csharp with Gnublin modules

good one, it works. thank you

Gclub Casino

Autor:  Porsrun [ Sa 1. Jul 2017, 08:42 ]
Betreff des Beitrags:  Re: Mono Csharp with Gnublin modules

Es wäre toll, mehr über dieses Thema zu lesen, danke für den Austausch dieser Post.

โกลเด้นสล็อต
gclub

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde [ Sommerzeit ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/