05-08-2014 07:34 PM
05-08-2014 07:38 PM
We are happy to help you with your homework, so please tell us what you tried so far and where you got stuck.
05-08-2014 07:47 PM
This is what I have and I also have an example for you to see what i need to get.
I started making a boolean array with the 7 switches and I conected it to a boolean-numeric conversor and then I conected that to a numeric display.
But I need that when I make a 3 with the switches, an other display can show the number 3.
I have no idea how I can make that happens because Im new in labview.
Thanks for the help.
05-08-2014 07:59 PM - edited 05-08-2014 08:02 PM
It seems like you are solving the reverse problem. (Actually, the problem description is rather poor.) Typically you enter a number, then use boolean values to determine what LED's to turn on.
Even though the problem says "switches", that just doesn't look right. Those types of switches just look the same whether they are off or on. Especially when some are horizontal and some are vertical. Try LED's. Or at least a boolean "push-in" switch that lights up when depressed.
Your Array to Number function does nothing except give you a binary representation of which switches are depressed. It does nothing to decode it to a digit that would be in a 7-segment display. That can help you determine which set of switches are depressed, but certainly isn't what you should be displaying on the screen. Side question, what are you supposed to show if the switches you press don't equal any meaningful digit on a 7 segment display?
Why did you attach the second VI which is password protected?
05-08-2014 08:18 PM
I know it seems like I´m doing it backwards, but I'm not, this is what I need.
Whe I move the switches to creat number 7, the numerical display must show number 7. Did you see the example??
I can't make it with leds (which will be easier).
I don´t know how else I can explain to you what I want to do, and is frustruating because I need to do that homework.
I hope you can help me.
05-08-2014 08:21 PM - edited 05-08-2014 08:31 PM
I guess the password protect VI is the template that should be duplicated.
Apparently, for eacxh recognized pattern, it should show the number, and for all other patterns, it should show "11".
Obviously, what you did so far does not solve the problem, but you are close. You could create a U8 lookup table for all 128 different LED combinations, then use the number you just got and index into it. Start out with all elements at 11, then change the 10 elements corresponding to recognized patterns to the corresponding number.
05-08-2014 08:34 PM
Why can't you use LED's? They are normally indicators, but you can change them to controls.
I would make an array of values that correspond to digits 0 through 9. Go ahead and use your boolean array to number to convert the "switches" on/off state into a binary number.
When you read the switches like you are doing and convert from boolean to a number, search the 1-D array for that number. The index found will be the digit (assuming you create your 1-D array correctly). If you search the 1-D array and it returns a -1, then you know it is the undefined number which I guess is the 11 for whatever reason.
Element 0 would be the binary equivalent of the 6 segments lit up. Element 1 would be the binary equivalent of the 2 segments ....
05-08-2014 10:26 PM - edited 05-08-2014 10:31 PM
get 7 leds into a cluster, reorder them (a-g) as #0-7 and use the array to cluster function...dont forget to size that function,otherwise broken arrow. make your pattern with your bool arrays into a 2D. then just index the # to output the 1D pattern that matches
05-08-2014 10:30 PM
That's what the assignment seems like it should be.
But he said he needs to do the reverse. Take the cluster, convert to an array, and then decode what digit that corresponds to, if any.
05-08-2014 10:33 PM
@RavensFan wrote:
That's what the assignment seems like it should be.
But he said he needs to do the reverse. Take the cluster, convert to an array, and then decode what digit that corresponds to, if any.
weird...7 segments are always indicators?