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):
$(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.