Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Axe Programmer on February 21, 2014, 12:16:00 pm

Title: Send( and Get Command
Post by: Axe Programmer on February 21, 2014, 12:16:00 pm
Hello to all these smart programmers, can somebody please give me an example program on how to send the variable A from one calculator to another using the link cord? i am working on a two player pong game. I am not exactlly sure how to use the Get or Send( command. Thanks for the help ;D. And which link port should i use? I have a TI-84 Plus Silver Edition OS 2.55MP. I want to be able to send between both 84s and 83s.
Title: Re: Send( and Get Command
Post by: Keoni29 on February 21, 2014, 12:46:23 pm
Send(BYTE,TIME) sends one byte. Keeps checking if the other calc wants to Get a byte until it times out. Returns 1 on success. Returns 0 when no byte was sent.
Get receives one byte. Never waits. Returns the byte on success. Returns -1 when no byte was received.

Mind that axe variables are two bytes long. When you send data using Send you only send the lower byte of a variable.'

You should use the linkport on the left. It says I/O on the back
Title: Re: Send( and Get Command
Post by: Axe Programmer on February 24, 2014, 11:57:13 am
Thanks, but can you please give me an example program?
If you stored 8 to A, how would you transfer the same value of A to another calculator?
Also, when you transfer variables between calculators, do they have to be the same model/os?
 :banghead:  ???  ;D
Title: Re: Send( and Get Command
Post by: willrandship on February 24, 2014, 11:58:29 am
On Sender calc:
Send(A,some amount of time)

On Reciever calc:
Get->A
Title: Re: Send( and Get Command
Post by: Matrefeytontias on February 24, 2014, 01:28:42 pm
It's a great pain since you'll have to take care of all possible delay. I don't really remember my attempts though, sorry.
Title: Re: Send( and Get Command
Post by: josh landers on March 01, 2014, 04:10:14 pm
 I dont see why one cant send a file? Is there an axiom for it?
Yah! Posted 40!!!!  :w00t:
Title: Re: Send( and Get Command
Post by: Keoni29 on March 01, 2014, 04:49:41 pm
You don't want to send an entire file back and forth for a pong game. You just need to send a couple of bytes every time the ball passes the edge of the screen.
These bytes are:
-Horizontal velocity
-Vertical velocity
-X/Y position depending on which part of the screen is facing the other calculator.
Title: Re: Send( and Get Command
Post by: DJ Omnimaga on March 01, 2014, 06:29:46 pm
To ensure that everything remains in sync and to be sure the game doesn't break if one calc is accidentally disconnected, would having each calc wait until the other sent new coordinate data work? That way, it would be slower, but if one calc is disconnected, gameplay would pause (with the ability to exit if it takes too long), then when the cable is connected again, gameplay would resume. Kinda like in Starcraft when a player is lagging.

This would also solve the problem about newer 84+ calcs having a clock speed that is slightly higher than older ones. (eg hardware A calcs run at 14.9 MHz instead of 15.1 or something)