www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Using D for Raspberry Pi expirements

reply aberba <karabutaworld gmail.com> writes:
I'm looking for resources on using D for basic Raspberry Pi 
programming...stuff like turning on and off an LED light. I 
believe it requires being able to call the Raspberry OS core APIs 
from D as available in Python.

Anyone here tried something like that using D?
Sep 25 2019
next sibling parent reply Mike Franklin <slavo5150 yahoo.com> writes:
On Wednesday, 25 September 2019 at 23:56:45 UTC, aberba wrote:
 I'm looking for resources on using D for basic Raspberry Pi 
 programming...stuff like turning on and off an LED light. I 
 believe it requires being able to call the Raspberry OS core 
 APIs from D as available in Python.

 Anyone here tried something like that using D?
the pigpio C library (http://abyz.me.uk/rpi/pigpio/pdif2.html) and it workes great. You should be able to do the same with D. Mike
Sep 25 2019
parent reply aberba <karabutaworld gmail.com> writes:
On Thursday, 26 September 2019 at 00:09:30 UTC, Mike Franklin 
wrote:
 On Wednesday, 25 September 2019 at 23:56:45 UTC, aberba wrote:
 I'm looking for resources on using D for basic Raspberry Pi 
 programming...stuff like turning on and off an LED light. I 
 believe it requires being able to call the Raspberry OS core 
 APIs from D as available in Python.

 Anyone here tried something like that using D?
the pigpio C library (http://abyz.me.uk/rpi/pigpio/pdif2.html) and it workes great. You should be able to do the same with D. Mike
I have no idea how to do that from D. Any help/resources on that?
Sep 29 2019
next sibling parent Mike Franklin <slavo5150 yahoo.com> writes:
On Sunday, 29 September 2019 at 11:36:00 UTC, aberba wrote:

 I have no idea how to do that from D. Any help/resources on 
 that?
You should be able to use the techniques at https://dlang.org/spec/interfaceToC.html to declare the C functions that you wish to use in your *.d source files, and then, when you compile, pass `-lpigpiod_if2` to the linker. Mike
Sep 29 2019
prev sibling parent reply Aldo <aldocd4 outlook.com> writes:
On Sunday, 29 September 2019 at 11:36:00 UTC, aberba wrote:
 On Thursday, 26 September 2019 at 00:09:30 UTC, Mike Franklin 
 wrote:
 On Wednesday, 25 September 2019 at 23:56:45 UTC, aberba wrote:
 I'm looking for resources on using D for basic Raspberry Pi 
 programming...stuff like turning on and off an LED light. I 
 believe it requires being able to call the Raspberry OS core 
 APIs from D as available in Python.

 Anyone here tried something like that using D?
the pigpio C library (http://abyz.me.uk/rpi/pigpio/pdif2.html) and it workes great. You should be able to do the same with D. Mike
I have no idea how to do that from D. Any help/resources on that?
Maybe you can use this dub package? http://code.dlang.org/packages/dgpio I'm using a D app on a raspberry Pi to open my house portal for 1 year now. It works perfectly. The "hardest" part is the compilation. I tried this guide yesterday: https://wiki.dlang.org/Programming_in_D_tutorial_on_Embedded_Linux_ARM_devices and it worked perfectly fine. I compiled my app from Windows with a Debian (from the windows store) and uploaded my executable compiled with ARM target.
Sep 29 2019
parent aberba <karabutaworld gmail.com> writes:
On Sunday, 29 September 2019 at 16:26:48 UTC, Aldo wrote:
 On Sunday, 29 September 2019 at 11:36:00 UTC, aberba wrote:
 On Thursday, 26 September 2019 at 00:09:30 UTC, Mike Franklin 
 wrote:
 [...]
I have no idea how to do that from D. Any help/resources on that?
Maybe you can use this dub package? http://code.dlang.org/packages/dgpio I'm using a D app on a raspberry Pi to open my house portal for 1 year now. It works perfectly. The "hardest" part is the compilation. I tried this guide yesterday: https://wiki.dlang.org/Programming_in_D_tutorial_on_Embedded_Linux_ARM_devices and it worked perfectly fine. I compiled my app from Windows with a Debian (from the windows store) and uploaded my executable compiled with ARM target.
Thanks. Appreciate.
Sep 29 2019
prev sibling parent reply aberba <karabutaworld gmail.com> writes:
On Wednesday, 25 September 2019 at 23:56:45 UTC, aberba wrote:
 I'm looking for resources on using D for basic Raspberry Pi 
 programming...stuff like turning on and off an LED light. I 
 believe it requires being able to call the Raspberry OS core 
 APIs from D as available in Python.
Just found this package dating back from May 2016...let's see what it can do (https://github.com/fgheorghe/D-Lang-Raspbian-GPIO-Module)
 Anyone here tried something like that using D?
Sep 25 2019
parent reply Dave Chapman <donte5379 comcast.net> writes:
On Thursday, 26 September 2019 at 00:10:40 UTC, aberba wrote:
 On Wednesday, 25 September 2019 at 23:56:45 UTC, aberba wrote:
 I'm looking for resources on using D for basic Raspberry Pi 
 programming...stuff like turning on and off an LED light. I 
 believe it requires being able to call the Raspberry OS core 
 APIs from D as available in Python.
Just found this package dating back from May 2016...let's see what it can do (https://github.com/fgheorghe/D-Lang-Raspbian-GPIO-Module)
 Anyone here tried something like that using D?
I've been using https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/ . It is a C library written by Bartosz Golaszewski. He is actively working on it. The latest update is a week old. It has the advantage that you don't have to use sudo to access the gpio pins. It comes with a set of tools written in C that I have been converting to D. Since my knowledge of both D and C is weak it has taken me some time to get things going. I have a hand written D bindings file that is incomplete and of amateur quality. So far I have converted 2 of the 6 command line tools that Bartosz Golaszewski provided to to work with the library. David Chapman
Sep 26 2019
parent reply aberba <karabutaworld gmail.com> writes:
On Thursday, 26 September 2019 at 17:26:25 UTC, Dave Chapman 
wrote:
 On Thursday, 26 September 2019 at 00:10:40 UTC, aberba wrote:
 [...]
I've been using https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/ . It is a C library written by Bartosz Golaszewski. He is actively working on it. The latest update is a week old. It has the advantage that you don't have to use sudo to access the gpio pins. It comes with a set of tools written in C that I have been converting to D. Since my knowledge of both D and C is weak it has taken me some time to get things going. I have a hand written D bindings file that is incomplete and of amateur quality. So far I have converted 2 of the 6 command line tools that Bartosz Golaszewski provided to to work with the library. David Chapman
your code... can you push it to GitHub so I can check it out?
Sep 29 2019
parent Dave Chapman <donte5379 comcast.net> writes:
On Sunday, 29 September 2019 at 11:26:41 UTC, aberba wrote:
 On Thursday, 26 September 2019 at 17:26:25 UTC, Dave Chapman 
 wrote:
 [...]
your code... can you push it to GitHub so I can check it out?
I haven't used GitHub or git. Is there some other way?
Oct 02 2019