Jump to content
THIS IS THE TEST SITE OF EUROBRICKS!
THIS IS THE TEST SITE OF EUROBRICKS!

Featured Replies

Posted

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

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).

  • 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

image.png.65b166734e61cfaa4ef88a430fba7059.png

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.

  • Author
8 hours ago, Tcm0 said:

image.png.65b166734e61cfaa4ef88a430fba7059.png

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

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.

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.

  • 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.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.
Sponsored Links