20cents Posted November 22, 2021 Posted November 22, 2021 (edited) 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, 2021 by 20cents Quote
20cents Posted November 23, 2021 Author Posted November 23, 2021 Has nobody an idea what the problem could be? Any help or questions are appreciated. Thanks Quote
Munchkin255 Posted November 24, 2021 Posted November 24, 2021 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 Quote
Lok24 Posted November 24, 2021 Posted November 24, 2021 (edited) 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, 2021 by Lok24 Quote
20cents Posted November 25, 2021 Author Posted November 25, 2021 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 Quote
20cents Posted December 3, 2021 Author Posted December 3, 2021 I removed the loops and now it works. Thanks so much. 20cents Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.