
nogare321
USA
Asked
— Edited
Hi,
I'm currently working on a project where I need to be able to control the EZ-board through Matlab. I've managed to connect to the board over Bluetooth using Matlab, but I'm now stuck on the syntax and commands I need to use.
My questions are: 1- Do you have a list of the commands that are used in the ARC ? 2- What terminator charracter does ARC use at the end of the commands it sends to the board?
Thanks for any help!
It will take a bit longer, to learn programming in MatLab - but once you get it, it'll be a breeze
Is there a reason you are not using Visual Studio? Or even ARC?
I already know a little basic programming in MatLab, just not enough to communicate properly with the EZ-Board.
There are three main reasons I'm using MatLab over ARC and Visual Studio.
Would you be able to tell me what the EZ-Board sees when ARC sends the command: Servo(D0,60) through the script console? Does ARC interpret this command to binary or assembly?
Thanks!
... or Python?
Just in case anyone else ever has this problem, I've managed to get MatLab working! (angelic hallelujah chorus in background). It was relatively simple, like all good fixes. It just took me hours to workout MatLab's confusing methods.
The code to connect to the board is as follows:
asm = NET.addAssembly('pathName\EZ_B.dll') board = EZ_B.EZB; board.Connect('COM6');
To control the servos the code is:
board.Servo.SetServoPosition(EZ_B.ServoPortEnum.('D0'), 20,2)
This should move servo D0 to position 20 at speed 2.
MatLab seemed to do something funny with the Enums, compared to Visual Studio. The Enums were listed (by using the command asm.Enums) as 'EZ_B.Servo+ServoPortEnum', yet in order to use the Enum it had to be writen as I did in the above command. Very strange.
Hope this helps someone in the future!