Go to Post I feel like watching match videos from 2003 could be considered a form of cruel and unusual punishment. - Cory [more]
Home
Go Back   Chief Delphi > CD-Media > Photos
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

photos

papers

everything



Programming is as easy as you make it.

nxtmonkeys

By: nxtmonkeys
New: 19-02-2014 11:42
Updated: 19-02-2014 11:42
Views: 1070 times


Programming is as easy as you make it.

Here's a sample of a simple program that uses while loops, case structures and flat sequence structures.

Recent Viewers

  • Guest

Discussion

view entire thread

Reply

19-02-2014 11:59

Whippet


Unread Re: pic: Programming is as easy as you make it.

I had been told that it wan't possible to use while loops in Teleop. I guess I was wrong. This is cool!



19-02-2014 12:01

cjl2625


Unread Re: pic: Programming is as easy as you make it.

I'm pretty sure that wouldn't be good for use in teleop



19-02-2014 12:01

notmattlythgoe


Unread Re: pic: Programming is as easy as you make it.

Quote:
Originally Posted by Whippet View Post
I had been told that it wan't possible to use while loops in Teleop. I guess I was wrong. This is cool!
As long as it is in a separate thread its fine.



19-02-2014 12:02

cjl2625


Unread Re: pic: Programming is as easy as you make it.

Quote:
Originally Posted by notmattlythgoe View Post
As long as it is in a separate thread its fine.

Oh, well I guess you could do that then



19-02-2014 12:02

nxtmonkeys


Unread Re: pic: Programming is as easy as you make it.

Just wire something to the Loop Condition terminal so that it can end. While loops are useful for Autonomous too.



19-02-2014 12:42

geomapguy


Unread Re: pic: Programming is as easy as you make it.

Timed actions are best processed in Periodic Tasks

They will slow down your TeleOp code if placed there



19-02-2014 13:14

Mark McLeod


Unread Re: pic: Programming is as easy as you make it.

This example is good for use in Autonomous and Periodic Tasks.
As shown, this example cannot be placed in Teleop.



19-02-2014 13:24

nxtmonkeys


Unread Re: pic: Programming is as easy as you make it.

I made this program up to help out someone who wanted to know if he did it right. based on all of your posts, I was able to help him a lot more. Thanks a ton!



19-02-2014 13:44

Jay1986


Unread Re: pic: Programming is as easy as you make it.

That is not the safest way to accomplish that task nor should it ever be in teleop. You should write the inputs from the joysticks to global variables and read them in period tasks in their appropriate loops.



19-02-2014 13:50

nxtmonkeys


Unread Re: pic: Programming is as easy as you make it.

Yeah, I told him that. I haven't gotten a reply yet, though.



19-02-2014 13:56

geomapguy


Unread Re: pic: Programming is as easy as you make it.

Quote:
Originally Posted by Jay1986 View Post
That is not the safest way to accomplish that task nor should it ever be in teleop. You should write the inputs from the joysticks to global variables and read them in period tasks in their appropriate loops.
Do you ever have to write them as global variables?

You can just reference the joystick in Periodic Tasks



19-02-2014 14:01

nxtmonkeys


Unread Re: pic: Programming is as easy as you make it.

Well, I'M not using the program. I recently uploaded a few pictures of my teleop program.







19-02-2014 14:03

Alpha Beta


Unread Re: pic: Programming is as easy as you make it.

Quote:
Originally Posted by geomapguy View Post
Do you ever have to write them as global variables?

You can just reference the joystick in Periodic Tasks
You don't have to...
...But if you do you can manipulate those variables in autonomous.



19-02-2014 14:13

nxtmonkeys


Unread Re: pic: Programming is as easy as you make it.

I'm just happy that the code WORKS.



19-02-2014 14:14

Conor Ryan


Unread Re: pic: Programming is as easy as you make it.

I have found that when using Labview, Stacked Sequences are insanely helpful for programming autonomous. I haven't seen too many people use them.



19-02-2014 14:16

nxtmonkeys


Unread Re: pic: Programming is as easy as you make it.

Without the sequence structures, my autonomous would make my robot die in agony.



19-02-2014 14:17

geomapguy


Unread Re: pic: Programming is as easy as you make it.

Quote:
Originally Posted by Alpha Beta View Post
You don't have to...
...But if you do you can manipulate those variables in autonomous.
But you can still manipulate the variables in auto mode..

I must be missing something



19-02-2014 14:18

nxtmonkeys


Unread Re: pic: Programming is as easy as you make it.

I also, must be missing something. Help!



19-02-2014 14:46

Pault


Unread Re: pic: Programming is as easy as you make it.

Quote:
Originally Posted by Conor Ryan View Post
I have found that when using Labview, Stacked Sequences are insanely helpful for programming autonomous. I haven't seen too many people use them.
Stack sequences are definitely easy, but ideally your gonna want to use a state machine. Even if at first it seems as though using a stacked sequence would have been the better way, you will come to appreciate the ability to control what state comes next as you start to modify your auton and make it more complex.



19-02-2014 14:47

nxtmonkeys


Unread Re: pic: Programming is as easy as you make it.

Quote:
Originally Posted by Pault View Post
Stack sequences are definitely easy, but ideally your gonna want to use a state machine. Even if at first it seems as though using a stacked sequence would have been the better way, you will come to appreciate the ability to control what state comes next as you start to modify your auton and make it more complex.

What is a state machine?



19-02-2014 14:57

markmcgary


Unread Re: pic: Programming is as easy as you make it.

Quote:
Originally Posted by nxtmonkeys View Post
What is a state machine?
LabVIEW Wiki State Machine

Wikipedia Finite State Machine



19-02-2014 14:59

nxtmonkeys


Unread Re: pic: Programming is as easy as you make it.

Oooooh. Now I understand! Thanks!



view entire thread

Reply
previous
next

Tags

loading ...



All times are GMT -5. The time now is 19:02.

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