Go to Post How you say something is often just as important as what you say. - Rachel Lim [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-05-2012, 12:57
kobitate94's Avatar
kobitate94 kobitate94 is offline
Webmaster
FRC #1683 (Techno Titans)
Team Role: Webmaster
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Johns Creek, Georgia
Posts: 7
kobitate94 is on a distinguished road
Exclamation Exporting text file for FTP access

Hi all.

Our team is participating in a kind of school carnival we call TitanFest. Since we already have a basketball hoop set up from our practice field, we have decided to run a basketball booth. I have created a scoreboard that grabs the score from a file and updates the score shown (it uses jQuery).

We are programming the scoring mechanism itself using an old robot's cRIO due to lack of time (it's tomorrow...). What we are having trouble with is getting the score to export to a text file. The score is simply an int that updates whenever the player scores. How can I get the score into a text file on the "robot" so that I can access it through the IP address? Here is the code that grabs the text file in case that makes a difference (it grabs it from the FTP sever it is hosted on as of now):

Code:
 $(document).ready(function() {
 	 $("#myscore").load("score.txt");
   var refreshId = setInterval(function() {
      $("#myscore").load('score.txt');
   }, 1000);
   $.ajaxSetup({ cache: false });
});
The code simply reloads the DIV with the ID "myscore" and replaces its text with what it sees in score.txt.

Edit: I put up another topic on this but I deleted it now that we have sort of changed how we were doing it.

Last edited by kobitate94 : 03-05-2012 at 12:59. Reason: minor detail
Reply With Quote
  #2   Spotlight this post!  
Unread 14-11-2012, 13:28
JonBons3660 JonBons3660 is offline
Registered User
FRC #3660 (Lightsabers)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Oklahoma
Posts: 1
JonBons3660 is an unknown quantity at this point
Re: Exporting text file for FTP access

Take a look at this:
http://code.google.com/p/grtframewor...GRTFileIO.java

That should be all you need to write to the cRIO, we've been experimenting with this off season and it seems to work pretty good!
Reply With Quote
Reply


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 09:57.

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