I have been battling to get linking with my arduino working for a long time. My first attempt was with the old linking routine you (Kerm) made, which was to no avail. I tried 2 different jacks and swapping the data lines. Before with the old routine my calculator would randomly lag when ever it was connected to the arduino. Now with the new routine it does absolutley nothing, I tried the LED example sending data {0} - {15}, Serial monitor printed nothing. I also tried the key example and it repeatedly returned error -2, write timeout. I don't think the ground is being bridged to the data or anything like that but I really don't know what is wrong. Help is greatly appreciated.
Welcome to Cemetech, ben! I hope we can resolve this relatively easily. Which pins are you using for red and white? Which type of Arduino do you have? Which calculator model do you have? I assume you're running the Arduino sketches with the calculator at the homescreen?
I have a Ti-84 Plus SE, an arduino uno, I am running the program on the Arduino with the calc on the home screen, and the pins I am using are 6 and 7. The 2.5mm jack is wired up like so:
SHIELD -> BLACK -> GND
TIP -> BLUE -> Pin 6
RING -> YELLOW -> Pin 7

I used yellow and blue because I didnt have red and white wires lying around. I am also not sure which line should be on which pin.
I assume you've checked to make sure that you have the colors correct? What plug are you using, if it's not one from TI (which has white, red, and black wires inside)? Make very sure that it is completely seated inside the socket: third-party 2.5mm plugs often have too wide of a barrel and don't fit all the way in. I'd be willing to bet that that might be your problem; you could consider solving it (carefully) with a pocket knife or pencil sharpener.
Thats what I have been thinking but it seems like it fits all the way down in, but its really hard to tell. I took the plastic coating off of it so its just down to the metal piece... maybe thats the problem? However I had to because it wouldn't fit down in with it.

Ok I've determined that it was not fitting all the way down in the i/o port. I'm at my shop and I ground the rim on the jack down with a metal laythe, now it seems to fit down in better so I will test it when I get home. I'll get back with results.
bengalgecko wrote:
Ok I've determined that it was not fitting all the way down in the i/o port. I'm at my shop and I ground the rim on the jack down with a metal laythe, now it seems to fit down in better so I will test it when I get home. I'll get back with results.
Ah, that's great! I'm glad you had the tools you needed to grind it down, and I look forward to hearing if that resolves the problems you were having. A minor quibble for the future: please edit your post if it's less than 24 hours since your last post, otherwise it's a double-post. Smile
It works! FINALLY! Thanks for the help, and providing the library. Finally I can start working on my robotic calculator grapher! Very Happy

Now, to use silent linking to pull the variable a from the calculator, what header do I use? Trying to figure this out, i've been reading this: http://merthsoft.com/linkguide/ti83+/silent.html But I am not sure what all that extra data is for in silent requests.

Sorry about the double post btw; wasn't really thinking about it.
bengalgecko wrote:
It works! FINALLY! Thanks for the help, and providing the library. Finally I can start working on my robotic calculator grapher! Very Happy
You're welcome! Please keep us up to date on your project. In fact, I'd be very curious to see a Your Projects topic where you tell us a little more about this idea and keep us posted on your progress. Smile

Edit: I almost missed your edit there! It's okay to post again, as long as you don't gave the last post in the thread. Smile Which extra data do you mean? What kind of silent linking request are you trying to perform? A variable request, a screenshot, something else?
I'm trying to pull the variable A from the calc into the arduino, but I'm not sure what all the extra data in the header is for silent variable requests. Also how does the conversion of data from the calc work? As in if I send a decimal from the calc can it be converted to a float on the arduino? I also want to know how to send a list with a dimension greater than 1.

EDIT: Nevermind I think I've figured out everything I need. Thanks for your help.
Hello KermMartian!

I deep again in my project to interact trough my TI-82 on an arduino and just discovered your nice library.

It works nice with standard examples but, I'm not sure to understand completely how it works and how to extend.

By example, I'm can easy get first value of list sended from TI ( Send({123}) ) to Arduino with:
int value = (int)TIVar::realToFloat8x(&data[2], model);

But if I try to get next value (stored in data[3]?) send from TI ( Send({123,456}) ) to arduino with:
int value = (int)TIVar::realToFloat8x(&data[3], model);

I always get a frustrating 0!

Where am I wrong?
The lists you're working with have elements that are each 9 bytes; the list is prefaced by a two-byte size field. Therefore, data[0] and data[1] are the size, data[2] is the start of the first 9-byte element, data[11] is the start of the second 9-byte element, and so on. I hope this helps. Smile
Thank you KermMartian!

It works now completely how I wanted!
I'm not used to this kind of array...

int m;
for(m=0; m< list_len; m++){
int p = 2+9*m;
int value = (int)TIVar::realToFloat8x(&data[p], model);
Serial.println(value);

}
Hello,

Now that I'm able to send values from my TI to Arduino, I want to get back a value from my Arduino to my TI.
Unfortunately, I can't use your function onSendAsCBL2.

Do you have an example of how to use it?
elfyps wrote:
Hello,

Now that I'm able to send values from my TI to Arduino, I want to get back a value from my Arduino to my TI.
Unfortunately, I can't use your function onSendAsCBL2.

Do you have an example of how to use it?
If you look in the examples/ folder, there are tons of handy examples. For example, the analog read example uses onSendAsCBL2:

https://github.com/KermMartian/ArTICL/blob/master/examples/ReadAnalog/ReadAnalog.ino
Sorry, as my english is not good, I've probably badly explained what I wanted to say.

I can run your example and get a list of n elements,
I can also easily change it to get a list of only one element (it's always GET(L1)) but what I can't do is adapt your example to get only one value (with GET(R)).

My idea is to open the possibilities to student to program with their calculators with externals datas as light, motor, ... (though cheap but so nice arduino).
I've made multiple tries (based on my comprehension on this: http://merthsoft.com/linkguide/ti83+/vars.html#real) but I always get a List.

By example, I can get {167} but I want 167.
Why? Because I want easily reuse this (real) value in a TI-Basic program.

I've seen during my test some interesting things like:
GET(A) => variable of type 65
GET(B) => variable of type 66
...
GET(R) => variable of type 82
...
GET(Z) => variable of type 90

With those tests, I understand that calculator don't ask and wait for a value and store it into a variable (A, ... Z) as I was thinking before.

I suppose then (please correct me if I'm wrong) that calculator send command to request a specific variable and copy his value into local variable with same name.

In this way, I have to prepare a value named "A" (by example), with specific value for responding to GET(A)'s call.
Then in example of Kerm, there is probably a value who indicate that list you send is L1(?)...

I continue to investigate...
elfyps wrote:
Then in example of Kerm, there is probably a value who indicate that list you send is L1(?)...


Finally, it appears that example work still differently I had supposed:
I've made some basics tests like:
GET(L1)
GET(L2)
GET(L3)
GET(L4)
GET(L5)
GET(L6)

But I always get type 1:
Got request for variable of type 1 from endpoint of type 149
elfyps, in 'Arduino to TI Calculator Linking Routines', wrote:
Unfortunately, I can't say to my calculator (TI-82+ working as as simple TI-82) to wait during an action during more than 2 seconds (time out?).

What's look my program working on calc:
Send({1, 1500}) //turn right servo during 1.5s
Send({2, 1000}) //turn left servo during 1s
Send({1, 1500}) //turn right servo during 1.5s

What's broken:
Send({1, 2500}) //turn right servo during 2.5s
Send({2, 3000}) //turn left servo during 3s
Send({1, 3000}) //turn right servo during 3s

I've tried to insert GET() after each SEND() to avoid time out with no success.

Any idea?

Thank you?

The link protocol supports blocking a calculator from running until a Get( completes, such as when a CBL is collecting data. The calculator sends a REQ packet, and the Arduino/CBL will respond with an ACK but wait until it is ready before sending the corresponding VAR packet. The calculator will act busy until the link exchange completes. See this link for an example of a CBL making a TI-83 wait for data. The link protocol used by the TI-83 (and the TI-82 Plus) is that of the TI-85. Whether ArTICL allows for a delay in the linking, I don't know. If it isn't implemented, it should be.

elfyps wrote:
elfyps wrote:
Then in example of Kerm, there is probably a value who indicate that list you send is L1(?)...


Finally, it appears that example work still differently I had supposed:
I've made some basics tests like:
GET(L1)
GET(L2)
GET(L3)
GET(L4)
GET(L5)
GET(L6)

But I always get type 1:
Got request for variable of type 1 from endpoint of type 149


What's happening here is that the calculator believes it is talking to a CBL, causing it to use the 0x95 endpoint. 0x95 indicates a calculator talking to a CBL/CBL2/LabPro and expecting a list using the TI-85 link protocol. The CBL (or in this case, the Arduino) responds with endpoint 0x15 with a list in TI-85 format. The Arduino receives type 1 request because the Arduino is expected to return a header with the correct information, and ArTICL takes care of this if properly set up.

I haven't used ArTICL enough to provide guidance on how to use it, but I do know the link protocol quite well.
Hi CVSoft,

Thanks to come help.

As you've proposed to me, I've implemented a delay() instruction between 2 calls of ticl.get() in KermMartian's example (Screenshot):

...
ticl.get(msg, NULL, &rlen, 0);
Serial.println("Recieved acknowledgement");
for(int i = 0; i < 10; i++){
delay(1000);
Serial.print(i);
Serial.println(" secondes");
}
ticl.get(NULL, screen, &rlen, 768+2);
...

It works like a charm. I can easily wait 10 or 20 seconds before getting screenshot.

Unfortunately, now I can't reproduce this with another Kerm's example (ReadAnalog) because of his special structure (due to CBL2 use?).

I'll try to investigate into ArTICL to change endpoint and be able to GET only a value.

MORE: Do you have a little example's script to easy reproduce examples given on http://merthsoft.com/linkguide/ ?
Adventure continues...

I've (tried to) deep into LinkGuide to better understand what's exactly used in ArTICL library.

By example (http://merthsoft.com/linkguide/ti83+/silent.html#request,
73 A2 0D 00 09 00 00 41 00 00 00 00 00 00 00 00 00 4A 00 Sent from Arduino can be sliced into 3 parts:
Header: 73 A2 0D 00
Data: 09 00 00 41 00 00 00 00 00 00 00 00 00
Checksum: 4A 00

Header consist in
73 -> Machine Type ID (named "model" in ArTICL)
A2 -> Command ID (Here means REQ)
0D 00 -> Length padded left (Means 13 bytes in data

Data (13 bytes as previously seen in Header)
09 00 -> Length of data's content padded left
00 -> Type ID (00 means Real Number)
41 00 00 00 00 00 00 00 -> Token of Variable A padded left
00 -> Version (always at 0)
00 -> Type ID byte (always at 0)

Checksum: of data only (don't care about header and don't exist if no data for some Command).
4A 00 -> Sum padded left where 4A = 41 + 9

This analysis marked here above is to be sure that I'm right about my comprehension of this and to give to others a split in same place of all datas (I had to run on multiple pages to get that wich I have to translate to understand...).

Now during my trip into documentation, I found a better (I think) way to set my calc on pause until my send() command hase been finished:
Silent Send a program to calc, wich be automaticaly executed by calc.
=> http://merthsoft.com/linkguide/ti83+/vars.html#program
In this case, we have "just" to send "Pause" into a program (represented by token 0xD8 as red on http://merthsoft.com/linkguide/ti83+/tokens.html)

Assuming I've correctly understood, for this, I'll have to send:
Header: 73 C9 06 00
Data: 03 00 05 01 00 D8
Checksum: E4 00

Now that I've this, I want to know how to send this to calc.

@Kerm: Can I use your ticl.send() function to directly send my packet?
If yes, could you show me how?

Thank you!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 5
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement