Question on Spike Prime

71 views
Skip to first unread message

Ian Chow-Miller

unread,
Jun 9, 2021, 1:17:55 PM6/9/21
to legoeng...@googlegroups.com, lego...@googlegroups.com
Hi, 

I hope that the attached video helps explain what I'm about to ask. I have a student who wants her machine to be started (and later stopped) by one of the sensors: pressure, distance, color. I've assigned a variable to randomly choose between 1 and 3. A few If/Else statements will start the machine depending on which one of those values is assigned. For example if the variable is randomly assigned 1, then the pressure sensor will have to be pressed to start the machine 

The problem is if the variable is randomly assigned 3 she wants the machine to be started by the color sensor. But we also want to randomly assign which color will start the machine. If we assign numbers to a new variable, I feel like we'd have to write If/Else statements. I'd love to just be able to assign a color to a variable instead. Any ideas?

Thanks,
Ian

ProjectB Coach

unread,
Jun 10, 2021, 7:12:24 AM6/10/21
to legoeng...@googlegroups.com, lego...@googlegroups.com

Hi Ian,

 

I threw this out to the brains trust and they came up with the following. Is this the type of approach you were after?

 

 

Note: We’re excluding Colour values of 2 and 6 because the colour sensor documentation doesn’t list colours for these values.

 

Regards,

 

Andrew Clark

Lead Mentor

Project Bucephalus

www.projectb.net.au

--
--
Robotics in Education - Mailing List
LEGO Robotics Resources available at www.damienkee.com
 
The aim of this mailing list is connect educators from around the world who have a common interest using robotics in education. We welcome any and all conversation that is on-topic, (and occasionally off-topic!) and strongly encourage all members, regardless of their level of experience, to be a part of the conversation. While we want our member to give their opinions on commercial products so that others may benefit, sales-pitch posts are not permitted.
If in doubt, please ask me off-line first - dam...@damienkee.com
---
You received this message because you are subscribed to the Google Groups "legoengineering" group.
To unsubscribe from this group and stop receiving emails from it, send an email to legoengineeri...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/legoengineering/CAKZe8KeVVmt9tULg%3DL0bSAsAE%3Dgcwfc3H3p1Sirw7WqYU%2BV18A%40mail.gmail.com.

Ian Chow-Miller

unread,
Jun 10, 2021, 8:33:33 AM6/10/21
to legoeng...@googlegroups.com

Kausing, Katrina

unread,
Jun 11, 2021, 7:43:43 PM6/11/21
to legoeng...@googlegroups.com
can you help me pls with my scratch assignment? I hope to hear from you soon. Thank you so much!

Respectfully yours,

Katrina Kausing
Advanced Biology Instructor    
Frederick Douglas High School
Phone number: 859- 381-3780 Ext. 52007        
  


From: legoeng...@googlegroups.com <legoeng...@googlegroups.com> on behalf of Ian Chow-Miller <iancho...@gmail.com>
Sent: Thursday, June 10, 2021 8:33 AM
To: legoeng...@googlegroups.com <legoeng...@googlegroups.com>
Subject: Re: [legoengineering] Question on Spike Prime
 

EXTERNAL MAIL:

CAUTION: This email originated from outside of FCPS. Do not click links, or open attachments unless you recognize the sender and know the content is safe.

Ian Chow-Miller

unread,
Jun 14, 2021, 11:58:47 PM6/14/21
to legoeng...@googlegroups.com, lego...@googlegroups.com
Hi Andrew,

Thanks for the idea. It did work for starting the robot randomly. As time in-person with students was very short this year we didn't have time to finish the program before we had to take robots apart and pack up for the end of the year.

I should have made the color to number connection earlier, but Spike Prime is new to me and I miss stuff. It does seem that there are three numbers between 1 and 10 (2, 6, 8) that don't correlate to a color value. I'm wondering what is the best way to write a "not ___ and not ___ and not____" statement in the block language. I'm sure it's easier in Python.

Thanks again,
Ian

ProjectB Coach

unread,
Jun 15, 2021, 8:44:22 AM6/15/21
to legoeng...@googlegroups.com

Hi Katrina,

 

Happy to help in any way I can! Send through the details to the group…

 

Regards,

 

Andrew Clark

Lead Mentor

Team #5985 (Project Bucephalus)

Reply all
Reply to author
Forward
0 new messages