View unanswered posts | View active topics It is currently Tue Sep 16, 2014 6:18 pm






Reply to topic  [ 6 posts ] 
LCD 
Author Message
Rookie

Joined: Thu Jul 08, 2010 3:50 pm
Posts: 18
Post LCD
I was under the impression that the LCD could be used to switch between programs that have been downloaded into a filing system. Does code need to be written to do this or is it done some other way?


Mon Jul 19, 2010 6:46 pm
Profile
Site Admin
Site Admin

Joined: Mon Jun 08, 2009 4:50 pm
Posts: 70
Post Re: LCD
Hi,

You are correct!

In the VEX sample programs folder you should see a file,
Attachment:
Program Chooser.c [2.94 KiB]
Downloaded 200 times


Instead of just compiling and downloading this program, go to:
Robot > Compile and Download ... > To Default Program Slot.

Now the program-chooser-program is in place. We just need to add programs for it to choose.

To do this, load some programs that you want to run, but again instead of just compiling and downloading, go to:
Robot > Compile and Download ... > To File System.

Any programs that have been downloaded in this way to the file system, will show up when you reboot your robot. You will see a screen with program names and arrows and can easily cycle left and right and run the selected code.

Hope that helps,


**EDIT**
For those that can't find these options:

You need to set your Menu Level to "Super User" (Window > Menu Level > Super User)

Also you must choose "Optional File System" (Robot > Compile and Download ... > Optional File System) for this to work.
********

_________________
Bence Feher

Undergraduate Intern - NREC, Robotics Academy
ROBOTC - Testing/Documentation/Developer

Computer Science, Japanese, East Asian Studies
University of Pittsburgh, Konan University 甲南大学


Last edited by bfeher on Thu Jul 22, 2010 10:21 am, edited 1 time in total.



Wed Jul 21, 2010 9:28 am
Profile
Rookie

Joined: Thu Jul 08, 2010 3:50 pm
Posts: 18
Post Re: LCD
Thank you for the last reply, it was very helpful. Now, is it possible to access .c files from a program? For instance, I use the program chooser to start a program and I run that program until a button is pushed, but then I would like the cycle to restart and go back to the Program Chooser. If these are stupid questions then I apologize, I am fairly new to C and very new to robotC.


Wed Jul 21, 2010 5:13 pm
Profile
Site Admin
Site Admin

Joined: Mon Jun 08, 2009 4:50 pm
Posts: 70
Post Re: LCD
Hi,

First off there are no dumb questions or embarrassing posts. People come here for help, remember that whoever answers your questions wasn't born with the knowledge and probably learned it in a way similar to you now.


Now to your question:

In short, yes you can. In long, hmmm its still in beta and no you can't.

Here's what I would do:

Download this,
Attachment:
Program Chooser live template.c [5.21 KiB]
Downloaded 199 times
and apply that template to your programs (basically putting your task main stuff into the task called "MyCode" [if you have other tasks, just throw them outside of main like normal])

What I've done is taken the file system chooser code from "Program Chooser.c" and made it into a separate task. This way if you apply this template to all of your programs and download them to the File System, while keeping the original "Program Chooser.c" file as the Default Program, all of your programs will have the ability to see and choose the other ones. Sorry if this sounds confusing, its like turning them all into "Program Chooser.c" but with your own added functionality.

It's not a nice file system, and its not how file systems should work, but its a neat (poor man's) work around by making each of your programs able to see the other ones.

Give it a try and feel free to ask any questions. I just wrote this quickly this morning and it may not be as good as we want, but I hope it helps.

quick recap:
- Program Chooser.c remains the default program file
- take your other programs and copy and paste the code into the "MyCode" task in Program Chooser live template.c
- rename it to something else
- download it to the file system
- repeat the above 3 steps for all other programs you wish to add choosing functionality to


**EDIT**
What I would really do, is just use "Program Chooser.c" as we discussed a few posts above, and just power cycle your robot after each program...but this method we are talking about with the template removes the power cycle from the process.

Unfortunately there is no "real" file system for the Cortex yet. For example you cannot delete a program with this beta file system. But its a nifty (or ugly depending on your perspective) work around.
*******

_________________
Bence Feher

Undergraduate Intern - NREC, Robotics Academy
ROBOTC - Testing/Documentation/Developer

Computer Science, Japanese, East Asian Studies
University of Pittsburgh, Konan University 甲南大学


Thu Jul 22, 2010 11:00 am
Profile
Rookie

Joined: Thu Jul 08, 2010 3:50 pm
Posts: 18
Post Re: LCD
Thanks for your understanding. So, I understand the modification to the program chooser, but i'm not clear on the power cycle option. Is the power cycle option a possibility or were you saying it's the best route, but not possible with beta?


Thu Jul 22, 2010 3:03 pm
Profile
Site Admin
Site Admin

Joined: Mon Jun 08, 2009 4:50 pm
Posts: 70
Post Re: LCD
If you just use the regular "Program Chooser.c" in the default slot, and then your own programs in the File System slots like before, then when you power cycle the robot it should bring up the program chooser screen again. Since the "Program Chooser.c" file has the line
Code:
#pragma defaultFile

it will always load first in the default file slot when you turn the robot on.

so something like this:

ON -> choose program -> program runs -> OFF -> repeat

But again, these are not real file systems unfortunately (v__v)

_________________
Bence Feher

Undergraduate Intern - NREC, Robotics Academy
ROBOTC - Testing/Documentation/Developer

Computer Science, Japanese, East Asian Studies
University of Pittsburgh, Konan University 甲南大学


Thu Jul 22, 2010 3:36 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.