Hi,
I have a 24 ch Mini Maestro that is now up and running after a very steep learning curve for someone who is new to most of this. Its an amazing little thing and the posibillities are endless
Now, the next phase of my project is to write a little VB.NET application that will display information from the running script.
I am starting out with the MaestroEasyExampleVb ( the only one for vb? ). I can use the TrySetTarget command to enable/disable outputs. This works well. But what I am most of all looking for is the command to read from the stack, equivalent of PEEK.
Also the equivalents of POKE and get_position would be great.
I have been looking through the material, searched around, and tried whatever I can think of but achieving nothing but frustration.
HELP PLEASE!!!
EDIT: Ok I got a little bit more idea now. I found the sub where TrySetTarget is defined:
''' <summary>
''' Attempts to set the target of
''' </summary>
''' <param name="channel">Channel number from 0 to 23.</param>
''' <param name="target">
''' Target, in units of quarter microseconds. For typical servos,
''' 6000 is neutral and the acceptable range is 4000-8000.
''' </param>
Sub TrySetTarget(ByVal channel As Byte, ByVal target As UInt16)
Try
Using device As Usc = connectToDevice() ' Find a device and temporarily connect.
device.setTarget(channel, target)
' device.Dispose() is called automatically when the "Using" block ends,
' allowing other functions and processes to use the device.
End Using
Catch exception As Exception ' Handle exceptions by displaying them to the user.
displayException(exception)
End Try
End Sub
So then, more precisely, my question is how to define something like ReadStackValue
Sorry I need this with spoon
EDIT II: I found this in the Usc.cs:
/// <summary>
/// Gets an array of shorts[] representing the current stack.
/// The maximum size of the array is stackSize.
/// </summary>
/// <remarks>If you are using the Micro Maestro and calling
/// getVariables more than once in quick succession,
/// then you can save some CPU time by just using the
/// overload that has 4 arguments.
/// </remarks>
public void getVariables(out short[] stack)
{
if (microMaestro)
{
MaestroVariables variables;
ServoStatus[] servos;
ushort[] callStack;
getVariablesMicroMaestro(out variables, out stack, out callStack, out servos);
}
else
{
getVariablesMiniMaestro(out stack);
}
}
I get this is the correct one?
Now how can I apply this in the code with correct parameters?
Example would be great. Thanks