Duplicate Question
The question on this page has been marked as a duplicate question.
Original Question
How would you write a linux program to read data from a joystick, and turn that data into a command that is pushed onto the que...Asked by Adhi
How would you write a linux program to read data from a joystick, and turn that data into a command that is pushed onto the queue?
Answers
Answered by
Steve
linux is not a programming language. A simple perl program might be
my @queue;
open JS,"/dev/joystick";
while (<JS>) {
push @queue, cmd($_);
}
close JS;
sub cmd {
my $js = shift;
my $cmd;
... code to form command ...
return $cmd;
}
my @queue;
open JS,"/dev/joystick";
while (<JS>) {
push @queue, cmd($_);
}
close JS;
sub cmd {
my $js = shift;
my $cmd;
... code to form command ...
return $cmd;
}
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.