Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Extra Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=68)
-   -   pic: Programming is as easy as you make it. (http://www.chiefdelphi.com/forums/showthread.php?t=126847)

nxtmonkeys 19-02-2014 11:58

pic: Programming is as easy as you make it.
 




Anyone need help with their programming?

Whippet 19-02-2014 11:59

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!

cjl2625 19-02-2014 12:01

Re: pic: Programming is as easy as you make it.
 
I'm pretty sure that wouldn't be good for use in teleop

notmattlythgoe 19-02-2014 12:01

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

Originally Posted by Whippet (Post 1346060)
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.

cjl2625 19-02-2014 12:02

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

Originally Posted by notmattlythgoe (Post 1346062)
As long as it is in a separate thread its fine.


Oh, well I guess you could do that then

nxtmonkeys 19-02-2014 12:02

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.

geomapguy 19-02-2014 12:42

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

Mark McLeod 19-02-2014 13:14

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.

nxtmonkeys 19-02-2014 13:24

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!:)

Jay1986 19-02-2014 13:44

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.

nxtmonkeys 19-02-2014 13:50

Re: pic: Programming is as easy as you make it.
 
Yeah, I told him that. I haven't gotten a reply yet, though.

geomapguy 19-02-2014 13:56

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

Originally Posted by Jay1986 (Post 1346174)
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

nxtmonkeys 19-02-2014 14:01

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.






Alpha Beta 19-02-2014 14:03

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

Originally Posted by geomapguy (Post 1346191)
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.

nxtmonkeys 19-02-2014 14:13

Re: pic: Programming is as easy as you make it.
 
I'm just happy that the code WORKS.


All times are GMT -5. The time now is 01:15.

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