Go to Post Let's not complain when we are getting magnificent items in the kit that teams just a few years ago could only wish for. - sanddrag [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


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:31.

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