My MicroBit Reaction Game

A reaction game: fun! A MicroBit: awesome! A Microbit reaction game: AWESOME AND FUN!

That’s exactly what my game is; awesome and fun!

I have already introduced what a MicroBit is, so let me get into what a reaction game is. It’s honestly pretty self explanatory. In simple terms, reaction game tests how fast you can react to something, which is exactly what my game is, but just on a Microbit!

My finished game!

There were two steps in making Shivani’s Symbol Sprint

1: My code

2: My physical game

Let’s start with the code. Here is a link so you can follow along.

https://makecode.microbit.org/_MY3LCphcCaj5

My code is too long for me to explain every single block, so I will just explain what the main idea is.

So the main idea of my game is for there to be three players. Each player sits in front of a symbol, and the symbols are a heart, a ghost, and a music note. Basically, the MicroBit selects and shows a random symbol of those three. The according player hits their paddle. They must hit it within 3 seconds, or it is considered wrong. Also, if they hit their paddle when it is not their turn, it is also considered wrong. When a player gets it wrong, their symbol is never showed again (this was the hardest part of my code by far). Then, when two of the players have gotten it incorrect, the last player standing is the winner.

I will explain the important key parts of my code.I made a list for the players. The players are 0, 1, and 2. The reason I did this was because if player 1 got eliminated, I couldn’t say, “Pick random number from 0 – 2 without choosing 1.” Therefore, I created a list, and instead of saying “select random number,” I created a function. To make this simple, I said that whenever a player is eliminated, their number in the list is replaced with -1, and -1 is removed from the list. This way, instead of selected a random number from a range, the call is returned with a random number in the list that only has the remaining players.

As I mentioned above, I have a timer in my game. Now, instead of using the running time feature, I decided to make a variable. This way, every second, the variable would increase by one. If the variable, which I called “Time,” reached value 3, the player would be wrong.

My second function was the one that took most of the time for this code. This function is called CheckForWinner. CheckForWinner is used after a player is eliminated. It is called, and checks the list to see if there is only one value remaining. If so, it declares that value the winner.

I know that my code sounds relatively simple, but when I sat down to actually code it, my brain was friend after 2 hours. It’s super hard to put your thoughts into code, even if you know exactly what you want the MicroBit to do.

The next part is my physical product. I used my hot glue gun to do most of this part. Here is a picture of my physical part without the Microbit and alligator clips inside:

I will start from the top.

The Microbit is positioned at the top, above the text and logo for Shivani’s Symbol Sprint.

It is made out of cardboard, hot glue, and tinfoil.

I hot glued my drawing of each symbol onto a small piece of cardboard.

I put player numbers, and you might be able to see player colors. This was for no reason at all…just to make it more colorful!

Because tinfoil conducts electricity, I got each paddle (also made of cardboard), and wrapped some of the top part in tinfoil. There is also a large piece of tinfoil on the bottom for my ground wire. (I will explain this in greater detail in the video).

That’s the main gist of my physical product. Now, time for videos!

Here is a video of my explaining what I just said above (better, of course!):

And here is another one of me playing my game:

I hope you liked this blog post and my game!

If I were to make this better, I would try to incorporate something where a player has 3 lives before they are out. I know exactly how to do this, but I just didn’t have the time.

Overall, I learned a lot from this project. For example, I learned all about functions and lists in my code. Aside from coding aspects, I learned how I should always keep persisting, even if something is not working how I want it to.

I enjoyed this project so much and I hope you enjoyed reading about Shivani’s Symbol Sprint!

PS: If for some reason, you cannot view the videos, email me and I will send you a link! Thank you!

My MicroBit Social Distancing Meter!

There’s nothing more important than safety during these times. We are constantly told to sanitize, wear masks, and social distance. But it seems like everyone has a different estimate of 6 feet, and we never realize when we come within 6 feet boundaries. How can we solve this problem?

With the last device I would ever think that would be useful here; a MicroBit.

You heard me right; our CSAI project was to build a Social Distancing Alert device with our MicroBit!

Where do I start?

I’ll walk you through my code:

At the beginning, (on start) it sets a radio group. It is important to have the same radio set group as your partner, or you won’t receive their radio message, meaning that the rest of the code is pointless because there is no other MicroBit to compare to.

Next, on the forever block, I said, “radio send string – “Have a Good Day.”” This is so that when my partner receives this string, their MicroBit will judge how far away they are from the sender. You must have the radio send string as your partner for it to work, although it doesn’t matter what you write, as long as it is the same.

Next, I made the block “on radio received – receivedstring). This is so that when I receive my partner’s string (Have a good day), my MicroBit can start to judge how far apart the two MicroBits are.

Next, I used a logic block. This is so that my Microbit can judge if I am 6 feet away from other MicroBits.

Now I will trick you like how Mr. Dembo tricked us.

It is “impossible” for a Microbit to measure distance.

But it is still possible.

Weird, right?

Thought so.

So what did we use to measure distance?

You probably would know if you read what I wrote above.

Radio signal!

That’s right!

Here’s how I did it:

I started by building this code. This was so that I could tell how strong the radio signal was from the distance of 6 feet. It turned out to range between -75 and -65.

Therefore, I plugged this into my previous code, and said that if the signal strength was greater than -85 (to be safe), the Microbit should show an x. This is because radio signal gets stronger the closer you get to another Microbit.

This worked perfect!

Well, almost perfect.

Turns out, there was a problem.

If there was an obstruction between the two microbits, the signal would get weaker, meaning that it wouldn’t think that you were too close.

For example, if I was 3 feet away from someone, but there was a backpack in between us, the Microbit would think that we are farther than 6 feet, because the backpack breaks the signal and makes it weaker.

Other than this, my code worked pretty perfect!

Thank you for reading this blog post! If you have a suggestion to solve my problem (such as suggest another input we could use), let me know! Hopefully you learned something!

Bye for now,

Shivani

My MicroBit Pedometer

On Friday, my class was given the challenge to create a pedometer using our microbit. You may ask, what is a pedometer? A pedometer tracks your steps during a certain time period using various sensors, the primary one being the accelerometer. Pedometers are often found in fit bits or smartwatches, or just by themselves.

A Simple Pedometer
A Microbit

Making a pedometer with the Microbit is possible in multiple ways. The first way we tried at school was using the shake feature. However, I found that this was not as accurate because if the pedometer was taped to my leg or shoe, it would not shake as it was secured down. Therefore, I suggested we try a different way; the accelerometer.

Now, this was A LOT more confusing than the shake. For example, I had to figure out how fast I walked in g-force. Tough.

One of the really difficult parts was making sure that my pedometer was only counting one step every time my leg moved. For example, if I didn’t tape the actual microbit to my leg, it would shake forward and backward for every step I took. I solved this by taping the wire right above the microbit onto my leg. (I needed a lot of tape for this!!!)

TAPE

Eventually, I figured it out! If you have any suggestions for me on how to make it more accurate, please drop a comment down below!

Here’s a video of me explaining my code:

And a video of me testing the code on my Microbit with 10 steps:

And guess what?

I dare you.

Guess.

I tried it with walking 100 steps, and watch the super short time lapse video down below to see what I got!!!

You probably can’t see if very well because of the time laps, but I got…..

101!!!!!!!!!!!!!!!!!!!!!!!!!!!

Not bad, right?

That’s it from me! Hopefully you enjoyed reading about my MicroBit pedometer project!

Bye until next time,

Shivani

Shivani’s Item Rush – An Alexa Skill

Have you ever heard of an Alexa skill? In simple, terms, it’s a game you can play on Alexa! But it’s not just a game, a lot of skills are useful, such as weather apps, or other skills that store and deliver data. A few popular ones are “Guess the Sound” and “Big Sky.”

Over the summer, I participated in a 6 week Alexa skills camp hosted by Amazon. During the camp, I learned how to brainstorm, create, and build an Alexa skill.

At the end of the camp, there was a competition in which over 50 kids participated to build an Alexa skill. Guess what? My team won the team challenge AND I won the individual! Yes!

So I wanted to share my skill with you! Click on this sentence to view my individual skill (Shivani’s Item Rush) in the Amazon Alexa Skills Store.

If you like it, please leave a rating!

We also made a “Guess the Sound” skill as a team, but I don’t think it’s on the skill store!

Anyway, that’s the skill! Enjoy!

Bye until next time,

Shivani

Born a Crime National Book Talk

On September 29th, at 4 PM, there will be a National Book talk hosted by the national project lit community. The book discussed will be Born a Crime by Trevor Noah.

Please buy Born a Crime in the Young Adult (YA) format, as it is a better fit for middle schoolers. Born a Crime should be available at your local library or on Amazon. (Mr. Shilhanek also has copies of the book.)

Here are some links that should help: Arlington Heights Memorial Library Amazon Palatine Library

This is a one of a kind opportunity for you, your child, or anyone interested to connect with others across the nation; all from books! This is the first ever book talk of the National Project Lit book club, and we look forward to seeing you!

A link will be sent out prior to the meeting.

Bye until next time,

Shivani

My Turtle Art Creation

For my turtle art creation, I made fireworks, stars, and buildings.

It’s kind of supposed to resemble the 4th of July at night, but you can call it any other happy night!

I started out making the fireworks. This was actually really easy because all I had to do was put in 3 commands for the turtle, and just tell it to repeat 10 times. You can see a picture of my code here:

You can probably tell this took me a while. Putting it together wasn’t hard, but it was pretty challenging to figure it out. The fireworks and stars were pretty straightforward. For the stars, I just repeated the code for the fireworks, but reduced the degree of rotation, as well as the amount forward the turtle drew.

However, the buildings were a different story. I underestimated how hard it would be. You might think that you just go forward, right, forward, right, and so on, but no! To make it look somewhat realistic, I tried to connect the buildings so that it looked better. This was harder than I thought. If I made one mistake, I would have to retrace the WHOLE code for the buildings. I also couldn’t repeat because I wanted the buildings to be different heights, widths, and lengths apart. It took me days to get them right!

Click on this sentence to make your own project with Turtle Art!

Overall, this was a really fun project, and I totally enjoyed it!

Bye until next time!

Shivani

About Me!

Hi! My name is Shivani! Welcome to my blog! I’m 11 years old and I go to Quest Academy, in Palatine, Illinois. I’ve been at quest for 8 years! (Since preschool!) Here’s a little bit about me:

I LOVE to read! It’s one of my favorite activities and I’ve been an avid reader since I was 5. My favorite book series is Warriors by Erin Hunter, but Harry Potter is not far behind! Also, you should know that I am obsessed with Hermione Granger (Ginny Weasley isn’t that far behind!). In case you don’t know who Hermion is, she’s one of Harry Potter’s best friends in JK Rowling’s hit series. I also LOVE dogs!!!!! I have a 3-year-old golden retriever English Cream named Astro. Here’s a picture of him:

I’ve been playing the violin for about 8 years. I play for the Betty Haag Music Academy. We have performed in many different places, such as Portugal, Germany, and we even played at Carnegie Hall when I was 6 years old. I also play the piano, and I’ve been playing for about 4 years. Click the audio clip to hear us play Bach Double!

I’ve been playing tennis since I was about 6. I love to play with my dad and older brother! Also, I love traveling. I’ve been to many countries such as Panama, Argentina, Belgium, Israel, India, and Spain! And that’s just some of them!

That’s all you need to know about me! I’m a really fun person and I am excited that you chose to read this! Thank you!

Bye until next time,

Shivani