Author Topic: Send( and Get Command  (Read 4330 times)

0 Members and 1 Guest are viewing this topic.

Offline Axe Programmer

  • LV2 Member (Next: 40)
  • **
  • Posts: 32
  • Rating: +0/-0
    • View Profile
Send( and Get Command
« 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.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Send( and Get Command
« Reply #1 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
« Last Edit: February 21, 2014, 12:47:07 pm by Keoni29 »
If you like my work: why not give me an internet?








Offline Axe Programmer

  • LV2 Member (Next: 40)
  • **
  • Posts: 32
  • Rating: +0/-0
    • View Profile
Re: Send( and Get Command
« Reply #2 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

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Send( and Get Command
« Reply #3 on: February 24, 2014, 11:58:29 am »
On Sender calc:
Send(A,some amount of time)

On Reciever calc:
Get->A

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Send( and Get Command
« Reply #4 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.

Offline josh landers

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 116
  • Rating: +1/-0
    • View Profile
Re: Send( and Get Command
« Reply #5 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:

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Send( and Get Command
« Reply #6 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.
If you like my work: why not give me an internet?








Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Send( and Get Command
« Reply #7 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)
« Last Edit: March 01, 2014, 06:34:19 pm by DJ Omnimaga »