
Darathian

Does anyone know if its possible and how to recreate the Sizeof command from Arduino processing in EZ-Script.
I am trying to port some code to EZ-Script but not quite sure how to accomplish this.
Here is what I am really trying to port:
Lets say you have a array of values:
int sequence[] = {0, 2, 4, 6, 8, 10, 9, 7, 5, 3, 1};
You calculate how many degrees each value represents. (Each value in the array means a certain number of degrees or servo position.
// Pre-calculate degrees per adjustment of turret servo. const int degreesTurret = 180/(sizeof(sequence)/sizeof(int)-1);
You use this value to move the servo that many degrees
theta = sequence[i] * degreesTurret;
Note: i gets incremented using i++;
Also what does the value from getping represent. Is that a raw value from the sensor or does that value have another meaning like distance in cm and inches.
Thanks
@Richard R
I copied and pasted those lines from the script help file. Seems like there might be something to update by the EZ- Robot team unless I missed an update that fixes that entry.
I am using a v4.
Thanks
Since the script by rich closely matches what i am trying to do i am going work through Rich's script and adjust it based on my needs.
I still have this nagging voice in the back of my head that wants to know how to iterate through an array but I will play around with it a bit and mostly ignore the voice for now
Thanks all
If you do wind up needing functionality not in ARC, there are a few options. The SDK can be used either standalone to completely replace ARC, but then you need to write everything in dotnet (either vb or c#, but more examples in c#) or to pass variables in and out of ARC, meaning virtually anything you can write in dotnet can be done with ARC.
If you don't know dotnet, there are a couple of good coders who participate here who often offer to help (in fact, that is what Justin was talking about a few posts up).
There are some other ways to pass data in and out without knowing dotnet (telnet, web, file i/o, rss) that can be used to integrate into external apps.
Finally, if you articulate a need that can't be done another way, DJ usually adds iit within a few releases. In fact, some capabilities that started as SDK projects have been built in as features because the need was obvious (like face recognition).
Alan
@thetechguru
I have been slowly familiarizing myself and I am aware of quite a few of the options. I do appreciate you pointing them out though.
I am somewhat familiar with c# and have used the sdk. It's EZ-Script I am trying to get a handle on since I am used to c#.
In this project I was trying to stay away from having two apps having to talk to each other so wanted to use EZ-Script by itself.
Some specific items regarding the arrays that struck me was this.
The script help refers to a fillarray command but when I try to type it into a script control it's not an option.
I was somewhat surprised not to see a do loop in ez-script.
Thanks
Hmmm.. I don't have a clue how to use it, but when I start typing "fill" into a script it pops up with FillArray( variable, default value).
I believe Repeat, RepeatUntil, and RepeatWhile commands work like do loop (but I am not a script expert, so take with a hefty grain of salt).
Alan
Odd perhaps I will try to reinstall my copy of ARC.
I am looking at the other loops to accomplish the same thing.
Thanks
I played around a bit and iterating through the array seems to work this way as long as you know the array size.
I am still trying to get a handle on getting the number of elements in the array (array size)