Posted November 22, 20213 yr Hi, I and my son started with a gear application one as a normal motor and one to shift the output to one of the four gears. This is the code for the switch gear with motor. We used four sliders to control the speed of the output. So if a new output is used, then the switch gear goes to the appropriate position and then the motor is started. Shifting works fine, the issue that we have is, that the normal motor stars to stutter and the switch gear behaves strange. I think there must be some elementary error in my programming but I don't see it. Is it allowed to control four sliders like this? or do I have to consider something I missed? Photo Thanks for your help for the first steps with mindstorms inventor kind regards 20cents Edited November 22, 20213 yr by 20cents
November 23, 20213 yr Author Has nobody an idea what the problem could be? Any help or questions are appreciated. Thanks
November 24, 20213 yr Hi I am not really an expert on the Mindstorms App. To me it looks like that one issue is that every time you move a new slider you will start a new sub-part of the program and subsequently a new infinite loop (widerhole fortlaufend). This means that if you move all four slides then the program will execute four loops all giving different commands to motor E. A possible solution might me to exchange the loop widerhole fortlaufend (run forever) with a run until block. And setup each of these loops to run until slider is 0. How does that work? Cheers Carsten
November 24, 20213 yr Hi, I think the four loops " wiederhole fortlaufend " should be removed completely. Just: - If slider is moved - call subroutine "Getriebeschalten" - start motor E with .... Edited November 24, 20213 yr by Lok24
November 25, 20213 yr Author Thanks a lot for your answers. I will try that out and gibe feedback. cheers 20cents 20 hours ago, Munchkin255 said: Hi I am not really an expert on the Mindstorms App. To me it looks like that one issue is that every time you move a new slider you will start a new sub-part of the program and subsequently a new infinite loop (widerhole fortlaufend). This means that if you move all four slides then the program will execute four loops all giving different commands to motor E. A possible solution might me to exchange the loop widerhole fortlaufend (run forever) with a run until block. And setup each of these loops to run until slider is 0. How does that work? Cheers Carsten Thanks Carsten, Your are right there is an issue. But till now I used only one slider at once and it was not working anyways. I will try if it helps to remove the continue loops. Thanks so far 20cents
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.