LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting arduino to LED matrix/array

0 Kudos
Message 71 of 97
(2,168 Views)

Comments / Criticisms of your state machine document:

 

  • Connection/Set Up
    • Connection/Set up is not a state
    • Why do you need an array of Cicular LEDs?  Are they Controls or Indicators?  Sounds like to me they shouldn't be an array.
    • Based on what you said about the LINX buttons, that sounds like two completely separate states
    • By design definition, a state machine is going to have a while loop.  Needing a While Loop is ambiguous.  Need it for what?
  • Initialization
    • This should be the name of the state for many of the things you were wanting to do in Connection/Set up
    • Think of this state as, "Initialize the Program itself"
    • User pushes Play button.....what's supposed to happen besides the button turns red?
    • Why do you need a case structure? For the state machine itself?
    • Does the initialization state turn the LEDs off or is that what happens when you press the button?
  • Initial Message, Ready
    • How do I get to this state?
    • What is play mode?
    • "....timer again."  Where was the first timer?
  • Player Mode/User Input
    • Timers can be done a variety of ways.  Tick count is one of them.  This will require a Global Variable with its own internal state machine.
  • Game Starts / Process Data
    • Why wait for 30 secs?
    • Random number generator will not provide just 1 or 0.  But values between 1 and 0.  Some sort of logic will be required to determine what dictates a 1 or 0 based on what the number generator provides.
    • Take action?
    • Write data to LEDs?  This is very dependent on what Arduino code you are using.  If it's this LINX (which I've never used), I'll just assume they have supplied you with pre-made code that you are initializing and operating with supplied SubVIs.  My suggestion would be to write your own Arduino code and communicate Serially.  But your way will work as well.
  • Game Messages
    • File I/O should technically be its own State, but you could do it here
    • A boolean/falg should be passed around in a shift register that defines whether or not this is the first or nth time played
  • Clicked Play Again
    • Because you have user controls, you're going to want to include an Event Loop
  • Clicked Exit
    • Definitely ^^
    • If stats to be displayed then exit...you'll need a delay.  This is where that timer Global Variable comes in handy (especially for blinking)
  • Stats / Analyze User Input
    • Disagree, this should be a separate option...not an exit option.  Exit options should simply exit
  • Error
    • This is typically not a UI thing
    • If Arduino loses connection, sure have a blurb say "Lost Connection to Arduino" otherwise, this code will not need error reporting

Final Thoughts/Questions:

  1. When is this due?
  2. Have you ever taken a LabVIEW class or programmed with LabVIEW before?
  3. Have you ever taken a C/C++ class or any type of programming class?
  4. Have you used a State Machine before?
  5. I highly recommend you create a flow chart that fully details how you want your code to operate.
  6. Are you using that LINX Arduino code?
Message 73 of 97
(2,115 Views)

Oh hey, Johnsold made a flow chart.  Didn't see that.  Well yeah, he said you'll need to elaborate on his flowchart, and he's right.  But he's doing exactly what I'm trying to do for you as well.  We're both trying to help you think like a programmer.

0 Kudos
Message 74 of 97
(2,104 Views)

thanks I will expanded 

0 Kudos
Message 75 of 97
(2,211 Views)

Thanks hope this is better.

 

 

0 Kudos
Message 76 of 97
(2,200 Views)

A LabVIEW class with no assignments?  How's anyone supposed to learn anything?  Professors today...seriously.

 

Anyways, due Tuesday?  Is this for a Jr. Project or a Sr. Project?  Was this assigned to you or did you come up with this project on your own?

Message 77 of 97
(2,191 Views)
Yup no assignments just in class tutorials with practice.
Yup due Tuesday. What is jr and sr? Came with game on own.
0 Kudos
Message 78 of 97
(2,177 Views)

Basically we just get a 2.5 hr class with just lecture and follow along on the compture as we learn how to work the key features and then we get an in class try it out/practice assignment for no credit.

0 Kudos
Message 79 of 97
(2,142 Views)

Oh, so this is your in class assignment that gives you no credit?

Message 80 of 97
(2,115 Views)