-
I d/l the OS image and flashed the SSD card, and it runs on the Raspberry PI. I now want to develop an application to light up an LED strip. So I need the library. The ONLY way I can get the library is via a Maven .POM file. I do not want to use Maven. I know that Eclipse has Maven, but I have never needed to use Maven, and I don't expect needing it in the future. Maven would be a one-time learning curve for me. Would it be possible for the files to be put in a ZIP file? I can d/l that then expand it into my project. Or a JAR file I can include as an external library? The alternate is to d/l each file (or copy/paste the code) and create a class, then paste the code into that. Very tedious. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 4 replies
-
https://pi4j.com/about/new-in-v2/ leads to https://pi4j.com/about/download/ You can find the zip files here. I think these should satisfy your eclipse IDE. Tom |
Beta Was this translation helpful? Give feedback.
-
Another alternative approach if you don't want to use Maven: JBang |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response. Ok, I d/l the libraries. I also need the code for the LEDStrip, so I followed the link from https://pi4j.com/examples/components/ledstrip/ to https://github.com/Pi4J/pi4j-example-components/tree/main/src/main/java/com/pi4j/catalog which I d/l. The catalog has many errors because of missing classes such as: Also a compiler directive: And so on. Right now I have 144 errors and 25 warnings in the project. I understand that this project is written and maintained, and believe me I greatly appreciate the effort. I am simply trying to connect one or more LED strips to a Raspberry PI 4. I guess I was hoping for an integrated single .jar (with JavaDoc) which could be included in my project, holding all the required classes to light an LED Strip Thanks |
Beta Was this translation helpful? Give feedback.
-
Honestly, LED strips are difficult to control from a Linux system as they require very strict timings. In such cases, a microcontroller is more suitable like Arduino, ESP32, Raspberry Pi Pico,... That's why I researched an alternative approach to still be able to do this from Java, with a separate LED board that can be controlled with another protocol. For instance, the Pixelblaze has serial communication. See https://pi4j.com/examples/jbang/pixelblaze_output_expander/ |
Beta Was this translation helpful? Give feedback.
-
I've used arduino, in fact they have a very good library known as FastLED. However I am planning to have up to 32 strings of 120 LED lights, and an arduino simply does not have the memory to hold that many LEDs. Each string would go out in turn, so no concurrent processing. Um, I'm using two 16 channel multiplexers, since I know the PI only has two pins suitable for LED strings. To get around the timing issue, I could break up each string into smaller array sizes, then send out each piece one after another. So for a 120 LED string, I could send 6 sets of 20. Since the information propagates down the string, this should work, and the short burst of sending also should stay within the timings. Or smaller chunks. The PI would be dedicated to only servicing the LED strips, so a minimum of background processes. Any idea where I can get the missing imports? |
Beta Was this translation helpful? Give feedback.
-
I think both Frank and I thought you wanted single LED operation not WSxxxx led strip or we might have spoken more about timing in the earlier posts. Include files: In those example components you would look into the POM file to see what libraries are needed and what repositories to search. I think that would be a frustrating exercise, just use MAVEN. But back to the timing concerns It is not CPU load but the critical timing of the data sent to the LED strip. I have not used the example component and so I do not know its reliability in controlling the LED strip. |
Beta Was this translation helpful? Give feedback.
-
Interesting video. I am not just outputting a light show. I am gathering information from other devices, processing it, then showing the results via an LED strip. To use another device to drive the LED strip, I would need to add communication between the PI and the device. This adds not only complexity, but also the number of devices required. I only update each LED strip every two seconds. Is the timing issue keeping up with a light show, or simply sending RGB to the strip? If it's the light show, then it should work. At any rate, I have gone through the code path which sends the colors to the LED strip and I should be able to make it work. I have everything in place, so just need to finish putting it together. Once I have it working, I can reply with the github link to the project, if you are interested? |
Beta Was this translation helpful? Give feedback.
-
You have the refresh rate hard coded into the LEDStrip code. I am allowing the user to choose which LED strip type they are using. So I have an enum for the strip type. You can incorporate it into your distribution if you want. The values are from https://github.com/FastLED/FastLED/wiki/Chipset-reference The Pulse Width Modulation rate is in the referenced doc, so I have included it, though I don't think you are using it. I have the amperage draw for when the user specifies the length of the string, I can give them an indication of how much of a power supply they would need. The Convert.toFileKey() removes spaces and changes to lower case. The EnumNotFoundException creates a message showing the class name, and the unknown key. I did a stint at IBM, and they (at that time) were using the prefix "iv" for instance variables, "cv" for class variables, and no prefix for block variables. That habit has stuck with me and I find it vastly easier to know where the variable belongs.
|
Beta Was this translation helpful? Give feedback.
-
Just am going through the PI 4 pins. And what do I find, there is a lot of nomenclature. Also physical pin numbers don't correspond with internal PI4 pin numbers. Sigh Ok, here are three more enums if you want them. They are related, so add one, add all :-) I did these because I hate hard-coded values. Plus the internal pin number is what I set, yet I show the physical pin number to the user for connection.
|
Beta Was this translation helpful? Give feedback.
https://pi4j.com/about/new-in-v2/ leads to https://pi4j.com/about/download/
You can find the zip files here. I think these should satisfy your eclipse IDE. Tom