I'm trying to write a code that calibrates all of my four motors. I've written the code for just one motor, and instead of doing a copy/paste job, I want to run that original code through a FOR loop for each motor. So, is there such thing as an array of motors? Something like
motor mymotor[motor1, motor2, motor3, motor4] ?
So that way I can just replace "motor1" everywhere in the original code for mymotor[i] (if i is the indexing variable for the FOR loop)?
Thanks.
Wed Oct 20, 2010 3:31 pm
jbflot
Site Admin
Joined: Tue May 15, 2007 9:02 am Posts: 383
Re: Motor Arrays?
Copying and pasting is probably your safest bet. The motor command is already a one-dimensional array, so adding multiple array indexes separated by commas will cause a compiler error.
Users browsing this forum: No registered users and 3 guests
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 post attachments in this forum