LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

25x25 boolean array to 40x40

Hi there

 

I have a 2D array that is currently 25x25. The array consists of LED's, that the user should be able to toggle.

Now first things first, is there a way to activate 25x25 LED's when the program runs? Currently, when the program runs, all the LED's are greyed out, until you toggle one. Then, the rows & cols up until that LED are enabled, but I want all the visible LED's, or well the 25x25 LED's to be enabled by default, so that you don't have to click the last LED on & off every time.

 

Next, I need to convert the 25x25 array to a 40x40 array. I know I could just 'center' the pattern from the 25x25 array, but it would be neat if I could enlarge the pattern somehow... Ofcourse the dimensions should be the same, so perhaps I should check for at least 5 rows at the sides & 5 cols at the sides that are all 0's, so that the array is at max 20x20, thus it can easily be transferred to 40x40..

 

Thanks in advance!

0 Kudos
Message 1 of 5
(2,377 Views)

The answer to the first question is to initialize the array with a populated 25x25 array boolean constant.

 

I'm not sure I understand your second question.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 5
(2,376 Views)

Aaaah that's what the initialize array is for! Works nice!

 

As for the second quistion; the 25x25 array is an array of LED's, where the  user can 'draw' a pattern that get's drawn by a robot. There's two sizes he needs to be able to draw, 25x25 and 40x40. Instead of needing two patterns for each size, I'd rather have that the user needs to draw only one pattern in the 25x25, and that this pattern gets transfered to a 40x40 if needed.

0 Kudos
Message 3 of 5
(2,368 Views)

Replace Array Subset. First initialize the 40x40 array and then use Replace to put the 25x25 data in the larger array where you want it.

 

Lynn

0 Kudos
Message 4 of 5
(2,364 Views)

Thanks for the reply, but I meant more reshaping the array and stuff. Found how I had to begin; I check the borders and see if there's 5 empty rows or 5 empty cols. If so, I have to do some resizing (this part is still missing). Else, it about centers the 25x25 array inside the 40x40 array.

0 Kudos
Message 5 of 5
(2,354 Views)