Posted August 11, 20195 yr Hello all I'm new to Mindstorms and I am trying to figure out whether the system will let me do something before I leap in. Here's a sketch of what I want to do, in the hope someone can help me. Is it possible to use Mindstorms to instruct a motor to follow a sequence of events it reads from an external file? E.g. - perform 10 rotations over 10 seconds perform 12 rotations over 10 seconds perform 18 rotations over 10 seconds perform 20 rotations over 10 seconds and so on and so on, potentially for hundreds of lines The goal here is to build a machine that can follow very precise programmed sequences. The data that drives that would have to be held in external files (probably just text files, or some sort of database) rather than constructing it in the Mindstorms app from potentially hundreds of blocks. Thanks in advance! /ben
August 11, 20195 yr Which programming language do you use? X3 has the ability to read files. They are in a table format (and I think that they are read as arrays).
August 11, 20195 yr Author 24 minutes ago, Tcm0 said: Which programming language do you use? X3 has the ability to read files. They are in a table format (and I think that they are read as arrays). I'm not using any language. I'm just trying to figure out how do-able this is. I'll look at X3... /ben
August 12, 20195 yr It should work more or less like that. There is no "move X rotations for X seconds" so you would have to calculate the speed from that. I'm not sure about the order the values get read/ written so you might have to write them from last to first.
August 12, 20195 yr Author 8 hours ago, Tcm0 said: It should work more or less like that. There is no "move X rotations for X seconds" so you would have to calculate the speed from that. I'm not sure about the order the values get read/ written so you might have to write them from last to first. Thanks. To clarify - are all those text nodes looking at the SAME external file? How do the motor nodes understand which bit of the text file is relevant to them? /ben
August 12, 20195 yr 1 hour ago, benredstar said: Thanks. To clarify - are all those text nodes looking at the SAME external file? How do the motor nodes understand which bit of the text file is relevant to them? /ben The file name is "abc" in this case, it's defined in the upper right corner. The first row is to write the stuff to the file. It's a list that contains "10", "10", "12", "20". The second row is the actual reading process. It reads the first value of the list (I'm not sure if it starts from the beginning with the 10 or from the end with the 20), the second read command reads the second value etc.
August 13, 20195 yr A text file in EV3-G looks like; 10 10 12 20 When you use the file read block, it takes a value from the top row and moves on to the next. When you want to return to the top, you have to close it. Also, I believe you can just import the text file to the project.
August 13, 20195 yr Author 16 hours ago, vl_cn said: A text file in EV3-G looks like; 10 10 12 20 When you use the file read block, it takes a value from the top row and moves on to the next. When you want to return to the top, you have to close it. Also, I believe you can just import the text file to the project. Thanks! Let me test this on the EV3 and I'll see what happens! Do you mind if I come back to ask more questions? /ben
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.