Posted October 29, 20204 yr Playlist: https://www.youtube.com/playlist?list=PLEtUplstSD6LBUDmrVRkfnH_kOBNbNsk0 Lesson 0: First program https://www.youtube.com/watch?v=YZapOCc3gI0 Lesson 1: Straight move https://www.youtube.com/watch?v=rloifkSs5g4 Lesson 2: Making turns https://www.youtube.com/watch?v=DH93AuYIz3U Lesson 3: Moving objects https://www.youtube.com/watch?v=mSs55CmwNeg Lesson 4: Stop at object https://www.youtube.com/watch?v=dG9XswdQ2UA Lesson 5: Stop at color https://www.youtube.com/watch?v=k2gg6YM4VaU Lesson 6: Stop when tapped https://www.youtube.com/watch?v=PPPROV9zZdY Lesson 7: Loops https://www.youtube.com/watch?v=XHTElkzA3uY Lesson 8: If-else https://www.youtube.com/watch?v=pIo3B96K-yk   Edited November 7, 20204 yr by Coder Shah Added additional videos
October 29, 20204 yr Author Thanks @Jim and @JintaiZ, glad you liked them! I've made a YouTube playlist and a second video showing how to create a Micropython program using the current version of the Robot Inventor app. Have edited the first post to include both. The code for each program will be in the video description. As I do more videos, I'll just add them as replies in this thread.
November 7, 20204 yr Author Just added some new videos to the playlist and updated the original post.
December 14, 20204 yr Hey Shah I am programming a 51515, M.V.P for the past few days I have been attempting to code a program for the 51515 that detects when the wheels are starting to drift off course and correct them. Do you have any tips on this? I am stumped.
December 15, 20204 yr Author 3 hours ago, Sam123 said: Hey Shah I am programming a 51515, M.V.P for the past few days I have been attempting to code a program for the 51515 that detects when the wheels are starting to drift off course and correct them. Do you have any tips on this? I am stumped. Sorry, don't have any ideas off the top of my head. Perhaps you can try going through the tutorials at https://primelessons.org/en/Lessons.html
December 25, 20204 yr Thank you for the tutorial! Do you know how to start 4 motors at the same time? Unfortunately I just found the "motor_pair" to control 2 motors.. motor_pair = MotorPair('A', 'B') Â
December 25, 20204 yr Author 2 hours ago, Gelo said: Do you know how to start 4 motors at the same time? Not at the moment, sorry!
December 26, 20204 yr I wonder what would happen if you made a "super" variable. motor_pair = MotorPair('A', 'B') motor_pair2 = MotorPair('C, 'D') my_motors = motor_pair + motor_pair2 Â Â
December 26, 20204 yr Thank you! I tried with the "super" variable but unfortunately it does not work. (TypeError) Actually I just want to code in Python that Gelo walks.. Â
December 26, 20204 yr Can't you just add , wait=False like with the EV3 to start all motors in row? Â In python for EV3 it's like; motor_a.run(600, wait=False) motor_b.run(600, wait=False) motor_c.run(600, wait=False) motor_d.run(600, wait=False) If running for some angle; MotorA.run_angle(600, 90, wait=False) and then last motor , wait=True for the program to wait untill it's finished.
December 26, 20204 yr maybe the syntax is wrong.  my_motors = (motor_pair,motor_pair2)  Just vamping. It would be very cool to get  Gelo to walk. I saw a youtube where a builder made his own robot and got it to walk.
December 30, 20204 yr Author On 12/26/2020 at 6:38 PM, Gelo said: Thank you! I tried with the "super" variable but unfortunately it does not work. (TypeError) Actually I just want to code in Python that Gelo walks..  You can check out @David Lechner's post in this topic: Â
December 30, 20204 yr On 12/14/2020 at 5:23 PM, Sam123 said: Hey Shah I am programming a 51515, M.V.P for the past few days I have been attempting to code a program for the 51515 that detects when the wheels are starting to drift off course and correct them. Do you have any tips on this? I am stumped. How about using yaw? I've only used word blocks, but I know you can access and test the yaw of the 6-axis accelerometer in the P-brick. You could set yaw to zero when it starts going, and then continually test for yaw going out of range -5 to 5 (or whatever). Figuring out how to adjust the motor speed to compensate is left as an exercise to the reader :)  ... Edited later: I was intrigued and tried it out. Using word blocks it's even easier than I thought, by adapting Tricky's line-following code, like this: first Set yaw to zero, then inside a repeat loop or other loop Start moving 2x(0-yaw) ; then outside the loop again Stop moving. Edited January 1, 20214 yr by sunspot added code example
January 16, 20214 yr I’m looking for angle sensors for mindstorms that I can read from python. Do you have some proposals of angle sensors (rotational) and some belonging python scipt? i know that I can use the angle information from motors but the motor it self requires some force to rotate and I don´t want to use that in project. Thank you very much
January 16, 20214 yr I want a rotational sensor with very low friction and therefor I don’t want to use a motor as sensor.
January 19, 20214 yr On 1/16/2021 at 12:56 PM, Pellewalle said: I want a rotational sensor with very low friction and therefor I don’t want to use a motor as sensor. @PellewalleBrainstorming a few ideas, maybe one of them might give you the seed of the solution to your problem. These have various tradeoffs between bulk and precision, so I don't know if any works for you. (1) The hub detects its own yaw. If the thing you're rotating can include the hub itself, rotating on a low-friction turntable, you could read the yaw to use in your program. (2) you could convert the rotation of what you want to rotate to linear motion using a pinion gear on the axle of rotation and a rack or set of tread links, or using a pulley or whatever rotational-to-translational mechanism you like, and then use the distance sensor. (3) the thing you rotate could include a multi-colored disk or platform and you could use the color sensor to determine which zone is close to it, if you only need a few discreet rotational zones, like a game spinner. (4) or the thing you rotate could be a colored beam and after you set it (without using the motor), you then use a motor to spin a separate beam with the color sensor on it, in a parallel plane with a colinear axle, use the color sensor to find the colored beam, and the motor's positional sensor to tell you the angle required to find the beam.
January 19, 20214 yr Hi, thank you for bringing in ideas. I have built a test bench for a vehicle chassis. In this model I cannot use the hub itself since I need to measure rotation angle with high (0.5-1 degree) precision to be able to examine some technical things, like how much play/rattle/delay it is in the drive line. I have found a angle sensor from mindsensors.com but I haven’t got any information from them conserning support for python. Maybe you have some proposal with this type of sensor?
January 24, 20214 yr eThank you @Coder Shah for the YouTube-Videos. But is there anything available like an old-school documentation (pdf?) regarding Python and Mindstorms 51515 ? The online-help is a piece of crap.... I hoped I could find pdf or windows-help-documents within the app-directory, but the only thing inside of it is a 500 MB big .exe-file.... hahaha.Â
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.