Go to Post Is that severed hand legal? I think it's a COTS assembly from previous years. - Taylor [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #13   Spotlight this post!  
Unread 27-02-2012, 21:20
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: What's the best way to test?

Quote:
Originally Posted by RyanN View Post
The Accumulation code makes sense, but won't work they way you think it will. You've created a rising edge (on button press) code trigger with the feedback node and the greater than > block. What this means is that the code will execute exactly one time when you press it down, and won't execute it again until you release and press that button again. Good job from this point.

Inside the case structure you have a T/F from another feedback node. So you'll press it once, and the motor will stop (from value 0), and then you press it again, it will go full 'forward' (from value 1) once the NOT block inverts your boolean F to T. So here's another good job from me.

The problem is that you are not constantly feeding the motor with a value. For safety purposes, motors are not allowed to continue their set value unless it is fed a value every so many milliseconds (I think it's like every 100ms). If you look at the given autonomous code, you'll see that they use a while loop instead of the simpler sequence structure. This is why this is done.

You can simply add another feedback node, with the motor control value in it, then add the motor to the outside of the case structure, as shown in the picture attached.

Attachment 12130

Here's how I would do it, because case structures clutter up the work area, plus it hides half of the code that can execute.

Attachment 12131
Ignore my shoddy explanation, here's a picture of the code I'm trying to describe.
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	21
Size:	34.9 KB
ID:	12134  
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:22.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi