Hey there. The new version of spike 3.3.0 got released a few days ago! Python is fully implemented again. Also love how they added the code completion prompts!
Hi! I have some problems with the HOLD, COAST, and BRAKE command. When i try to implement it in my program it says this: AttributeError: 'module' object has no attribute 'HOLD' Do you know what causes this and how I can avoid it?
9:38 I prefer to import the Time library: import time. and for the time library I import sleep: from time import sleep. And with this library I prefer to use it to wait with this library like this : time.sleep(seconds I want to wait).
Hi there! Great Job in this video. I am having trouble using the stop=motor_pair.HOLD or COAST / brake , command. Can you help me with that? Is there an alternative way through, to use the HOLD / COAST options?
Hi! I`m also working on this now. After the update it seems that these attributes work only with MOTOR, not motor_pair as before. (stop=motor. COAST //not sure if its the same thing as in video,tho//)
Great video, thanks! I'm having issues with the stop commands, at "stop=motor_pair.COAST," it gives me the error "COAST: Unknown. 'COAST' is not a known member of module." Same goes for .BRAKE and . HOLD. Any ideas?
@@tangojunky Sadly, no. The competition was coming up quick, so my robotics partner forced me to switch to word blocks so we would have functional code. If I had more time, I would've loved to try and fix it.
Not that I know of for 3.x, the best resource is the in-app help tab but it's not really extensive. I recommend reaching out to LEGO Education, maybe if more people ask then they will make it more accessible. Garry
Hi Gary, when entering the code I don't get the prompts for HOLD, BRAKE, COAST or CONTINUE infact I get red lines under HOLD and COAST stating they are unknown member of module, any ideas.
Hi! Have you imported motor_pair? Also, make sure you use the motor pair versions of the stopping modes, not single motor. Email me if you have any issues. Garry
@@CreatorAcademyAustralia Hi Gary, I was having trouble getting the HOLD to work so deleted Spike from my mac and reinstalled from the App Store. It appears to have been updated because Python was already there to program so I input the program as on UA-cam but the prompts are different to yours, please see the screen grabs attached. From the info it appears you can have motor.BRAKE but not motor_pair.Brake. I imported motor and Brake was an option. Any ideas? Best Regards Bernie Page Screenshot 2023-07-11 at 11.35.55.tiffScreenshot 2023-07-11 at 11.36.18.tiffScreenshot 2023-07-11 at 11.45.56.tiff
Hy Gary thanks for all you video’s I’m receiving the “AttributeError: ‘module’ object has no attribute ‘COAST’ I’m running the script from your Github and have the same error on my MAC and iPAD both of which are running the 3.3.1 version.
Did they change the way python works in Spike prime 3. I am still using the legacy software. Some of the way you write the code in this tutorial is different than past videos. I always love your videos. Thanks so much for the work you do.
How does the robot know the velocity and acceleration? Does it use gyro to compute that? If the robot is not moving as fast as the acceleration and speed specify in the function, does it increase the power output and check the speed in a feedback loop?
Hi - a dumb question here - other than some serious compute are there particular advantages to code Spike using Python instead of Scratch? Does python enable finer controlling?
Hi! Writing code using text gives kids a more challenging experience that is more similar to real-world coding. Python code is easier to manage in version control, and allows more precise motor control. Garry
Hi there! Python doesn't have an equivalent to 'stop other stacks', but you can 'break' out of loops that are running. I might do a tutorial on it soon! Garry
Thank you for great job, Im getting red underline when I inert the word COAST, HOLD await motor_pair.move_for_time(motor_pair.PAIR_1,2500,-30,velocity=1000,stop=motor_pair.COAST,acceleration=1000)@@CreatorAcademyAustralia
Hi! At the moment, the only place to view the documentation is through the Knowledge Base panel on the right hand side of the Python project within the SPIKE Prime app. Garry
Velocity 1000 should be 1000 degrees per second. Spike motors can run at 135-175 RPM, see the tech sheet: education.lego.com/v3/assets/blt293eea581807678a/bltb9abb42596a7f1b3/5f8801b5f4c5ce0e93db1587/le_spike-prime_tech-fact-sheet_45602_1hy19.pdf. Helpful video, thanks!
Hey there. The new version of spike 3.3.0 got released a few days ago! Python is fully implemented again. Also love how they added the code completion prompts!
I took too long to edit! Thanks for letting me know! Garry
great video for a teacher looking to move on from coding blocks
Works very well
Great explanations, pace of content and examples. Well done!
Glad you liked it! Thanks for watching. Garry
Hi!
I have some problems with the HOLD, COAST, and BRAKE command. When i try to implement it in my program it says this: AttributeError: 'module' object has no attribute 'HOLD'
Do you know what causes this and how I can avoid it?
I used a comma instead of a period that made it pop up
9:38 I prefer to import the Time library: import time. and for the time library I import sleep: from time import sleep. And with this library I prefer to use it to wait with this library like this : time.sleep(seconds I want to wait).
Hi there! Great Job in this video. I am having trouble using the stop=motor_pair.HOLD or COAST / brake , command.
Can you help me with that? Is there an alternative way through, to use the HOLD / COAST options?
Hi! I`m also working on this now. After the update it seems that these attributes work only with MOTOR, not motor_pair as before. (stop=motor. COAST //not sure if its the same thing as in video,tho//)
Thanks!
You’re welcome! Garry
Great video, thanks!
I'm having issues with the stop commands, at "stop=motor_pair.COAST," it gives me the error "COAST: Unknown. 'COAST' is not a known member of module." Same goes for .BRAKE and . HOLD.
Any ideas?
me too! Did you find any solutions on that?
@@tangojunky Sadly, no. The competition was coming up quick, so my robotics partner forced me to switch to word blocks so we would have functional code. If I had more time, I would've loved to try and fix it.
@@lian9276 try stop=motor.COAST
It works
Is there a reference document (just the libraries, classes, methods etc) somewhere for 3.x? I looked around and only found reference for 1.x or 2.x
Not that I know of for 3.x, the best resource is the in-app help tab but it's not really extensive. I recommend reaching out to LEGO Education, maybe if more people ask then they will make it more accessible. Garry
Hi Gary, when entering the code I don't get the prompts for HOLD, BRAKE, COAST or CONTINUE infact I get red lines under HOLD and COAST stating they are unknown member of module, any ideas.
Hi! Have you imported motor_pair? Also, make sure you use the motor pair versions of the stopping modes, not single motor. Email me if you have any issues. Garry
@@CreatorAcademyAustralia Hi Gary, I was having trouble getting the HOLD to work so deleted Spike from my mac and reinstalled from the App Store. It appears to have been updated because Python was already there to program so I input the program as on UA-cam but the prompts are different to yours, please see the screen grabs attached. From the info it appears you can have motor.BRAKE but not motor_pair.Brake. I imported motor and Brake was an option. Any ideas?
Best Regards
Bernie Page
Screenshot 2023-07-11 at 11.35.55.tiffScreenshot 2023-07-11 at 11.36.18.tiffScreenshot 2023-07-11 at 11.45.56.tiff
I have sorted it, I put motor_pair.stop instead of stop.motor.HOLD, should have paid more attention. Thanks for your help.
Hy Gary thanks for all you video’s I’m receiving the
“AttributeError: ‘module’ object has no attribute ‘COAST’
I’m running the script from your Github and have the same error on my MAC and iPAD both of which are running the 3.3.1 version.
after the update these attributes seem to work only for MOTOR, not motor_pair
Hi.
Struggling to use the motion / gyro sensor to turn a robot, say, 90 degrees.
Could do it fine in the old version!
any help gratefully received!
Hi! Check out part 2, it is made for you :D Garry
Did they change the way python works in Spike prime 3. I am still using the legacy software. Some of the way you write the code in this tutorial is different than past videos. I always love your videos. Thanks so much for the work you do.
Yes! It is completely different to before, it is more complex but also has more control. Thanks for watching! Garry
@@CreatorAcademyAustralia Thank you! I think you sold me on updating from legacy.
How does the robot know the velocity and acceleration? Does it use gyro to compute that? If the robot is not moving as fast as the acceleration and speed specify in the function, does it increase the power output and check the speed in a feedback loop?
Hi - a dumb question here - other than some serious compute are there particular advantages to code Spike using Python instead of Scratch? Does python enable finer controlling?
Hi! Writing code using text gives kids a more challenging experience that is more similar to real-world coding. Python code is easier to manage in version control, and allows more precise motor control. Garry
How do I sign into SPIKE
Any ideas how to replicate the "stop other stacks" block that exists in scratch in this new version of python?
Hi there! Python doesn't have an equivalent to 'stop other stacks', but you can 'break' out of loops that are running. I might do a tutorial on it soon! Garry
Is it for kids?? And mindstorm for older students. Lol i am a college engineering student. But seems fun lego and robotics💀
Students of all ages can use SPIKE to learn programming! Garry
Thank you for great job, Im getting red underline when I inert the word COAST, HOLD
await motor_pair.move_for_time(motor_pair.PAIR_1,2500,-30,velocity=1000,stop=motor_pair.COAST,acceleration=1000)@@CreatorAcademyAustralia
Where can I download the official documentation for this version of Python?
Hi! At the moment, the only place to view the documentation is through the Knowledge Base panel on the right hand side of the Python project within the SPIKE Prime app. Garry
can i use this for mindstorms 51515 too?
Hi! Mindstorms Robot Inventor continues to use the previous python version, see: ua-cam.com/video/Xj3mUHbb4Z0/v-deo.html
Velocity 1000 should be 1000 degrees per second. Spike motors can run at 135-175 RPM, see the tech sheet: education.lego.com/v3/assets/blt293eea581807678a/bltb9abb42596a7f1b3/5f8801b5f4c5ce0e93db1587/le_spike-prime_tech-fact-sheet_45602_1hy19.pdf. Helpful video, thanks!
Thanks for pointing this out! I have updated the video description. Garry