B4J Library pigpio for b4j

pigpio is a library for the Raspberry which allows control of the General Purpose Input Outputs (GPIO). pigpio works on all versions of the Pi.

I have use i2c(example), spi


get DIO hat use I2C and write text to I2c LCD

breadpi
 

Attachments

  • pigpiod.rar
    13.3 KB · Views: 241
  • breadpi_i2c.rar
    47.3 KB · Views: 215
Last edited:

max123

Well-Known Member
Licensed User
Longtime User
I admit that not already tried it. For sure I will try it when have some time.

In future I want to try control stepper motors with a driver like this directly from Raspberry.
DRV8825 Stepper Motor Driver

Because I want to control 4 and more stepper motors in the same time (controlling a 3D Printer and CNC machine)
and here need an high resolution GPIO control around 10 us resolution, I need to explore more solutions.

Probably require interrupts or something sophysticated like control any stepper motor on a different thread.

What is best suitable to do it for your opinion ? Pi4J or PIGPIO ?

Thanks
 
Last edited:

jinyistudio

Well-Known Member
Licensed User
Longtime User
Pigpio uses sockets, so the response time is long. You may need to use C language or similar to achieve the 10us you want.
 

max123

Well-Known Member
Licensed User
Longtime User
Thanks for reply, even jPi4J is too slow to archieve this timing ?

The only solution is to build the full project directly on C language, compilers like cMake and similar ...
... and abandon completely the idea to develop it on B4J with GUI interface and great development tool ?

Here a relevant discussion where author of PIGPIO replied, see 5 us, but probably
under C or C++ enviroment, and this is not strictly related to GPIO output togling a pin:
 
Last edited:

jinyistudio

Well-Known Member
Licensed User
Longtime User
In terms of jpi4j, you can experiment to see if you can output the step you want stably and at high speed. Sorry I don't have experience with this kind of application so I can't give you advice
 

jinyistudio

Well-Known Member
Licensed User
Longtime User

https://abyz.me.uk/rpi/pigpio/cif.html This is pigpio's website. There is also a C library with more functions than jpi4j, you can study to see if it is suitable
 

max123

Well-Known Member
Licensed User
Longtime User
Yes, need to be tested.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…