11-22-2020 05:45 AM
Hi, i have a problem with my project. I need to create an array of Leds with 20 lines and 40 columns which must be configurable. The interface must contain some buttons that will define a pattern : second row active, every second row active, only the middle led active, and the 4 corners active. The photo is just a reference so i need to do something a little different but the program need to do the same thing.
11-22-2020 06:44 AM
So what's your problem? You've stated what your VI is supposed to do, but you fail to state where you got stuck. Supply your attempt and we can help you work through it. We are not here to do your work for you.
11-22-2020 12:41 PM
@9Anonim9 wrote:
Hi, i have a problem with my project. I need to create an array of Leds with 20 lines and 40 columns which must be configurable. The interface must contain some buttons that will define a pattern : second row active, every second row active, only the middle led active, and the 4 corners active. The photo is just a reference so i need to do something a little different but the program need to do the same thing.
So basically you need a button (or buttons) to select and load predefined patterns into a Boolean array.
What part are you stuck on?
11-22-2020 04:12 PM - edited 11-22-2020 04:13 PM
If the patterns can be described in a few words, there is probably an algorithm to generate them with a few primitives'.
If you don't want to figure this out, just create a 3D array constant where each plane is one of your desired 20x40 patterns and you index into it based on the pressed button. Instead of all these separate buttons, consider a radiobutton containing all choices and wired it to the index. Keep it simple! (Even here you could create this lookup table at program start (or even compile time) with a little bit of code)
Sorry, I misread. You seem to want to combine multiple buttons, so just create a LUT for each button then OR the various 2D arrays.
11-22-2020 04:22 PM
Can you define "middle"? If there is an even number of elements, there is no "middle".
11-22-2020 05:02 PM
11-23-2020 09:28 AM - edited 11-23-2020 09:30 AM
I just used an Event structure to load predefined patterns in to the array when the corresponding button is pressed and update the Array of LED's indicator on the time out using a shift register
11-23-2020 12:04 PM
@RTSLVU wrote:
I just used an Event structure to load predefined patterns in to the array when the corresponding button is pressed and update the Array of LED's indicator on the time out using a shift register
This works for arrays of fixed size, but if the size also must be configurable, that will be tricky.
Note that the OP said:
"Hi, i have a problem with my project. I need to create an array of Leds with 20 lines and 40 columns which must be configurable. "
My impression was that the size also needs to be configurable, especially since the given example image shows an array that is NOT 40x20. <shrug>.
11-23-2020 12:16 PM
@altenbach wrote:
@RTSLVU wrote:
I just used an Event structure to load predefined patterns in to the array when the corresponding button is pressed and update the Array of LED's indicator on the time out using a shift register
This works for arrays of fixed size, but if the size also must be configurable, that will be tricky.
Note that the OP said:
"Hi, i have a problem with my project. I need to create an array of Leds with 20 lines and 40 columns which must be configurable. "
My impression was that the size also needs to be configurable, especially since the given example image shows an array that is NOT 40x20. <shrug>.
Well the OP was rather vague... An array of a given finite size that must be configurable?
11-23-2020 02:06 PM
It just means the size is NOT infinite. 😄