Pages

Friday, 24 May 2019

Sphero (Spin the Magic 8 Ball)

Sphero Edu App
In DTE we were given the project of making our own game using skills we have learned from previous lessons. We created programs like Spin the Top, Hot Potato and Toss game to learn different blocks to use. Spin the Top taught us how to spin the sphero multiple of times, Hot Potato taught us how to put random sounds, and the Toss game taught us how to make variables.

 We created our game using the Sphero Edu App and used block coding for our program.

I decided to make a game called 'Spin the Magic 8 Ball'. In this game, you will be able to ask Sphero questions like you will with a magic 8 ball, but instead of the answers being given out through a device or a talking voice, the answer will be given through 2 colours (each meaning 2 different answers) once shaken.


My Plan:


Spin the Magic 8 Ball


(Block Coding)


In this game, you will be able to ask Sphero questions like you will with a Magic 8 Ball, but instead of the answers being given through a device, the answers will be given through colours once spun, just like the Spinning Top game.



Before you start using your blocks and coding you must first create a program and name it. Something like 'Spin the Magic 8 Ball' should be a good name as it says what your program is going to be about, but you can name it anything you want.


Spinning Top  (Instructions)


  1. Go to Movements and select a ‘stabilization’ block.
  2. Turn the stabilization off
  3. Next, go to Lights & Sounds and choose a ‘back LED’ and set the brightness to maximum.
  4. Then choose a ‘speak’ block.
  5. Type in “Spin sphero like a top to get answers.”
  6. Now go to Controls and choose a ‘loop forever’ block
  7. Also, choose an ‘if true then else’ block and connect it inside the ‘loop forever’ block
  8. Go to Comparators and choose a ‘basic comparator’ and change the value to ‘>’. A basic comparator is a block where you can change the value to greater than, less than, and so on.
  9. Replace the ‘true’ on the ‘if true then else’ block with your ‘basic comparator’.
  10. Now go to Sensors and select a ‘pitch gyroscope’ block and put it on the left ‘0’ in the ‘if > then else’ block.
  11. Click/Tap on the ‘pitch’ and change it to ‘yaw’
  12. Go to Lights & Sounds and select a ‘main LED’ block and connect it under the ‘yaw gyroscope’ block.
  13. Now go to Operators and select a ‘color from’ block and connect it where the colour shows on the ‘main LED’ block.
  14. Put the colour as green.
  15. Go to Sensors and choose a ‘main LED’ block and connect it where the colour shows on the ‘colour from’ block.
  16. Go back to Operators and choose a ‘basic operator’ and connect it to the right of ‘channel of’.
  17. Change the + sign to a /
  18. Go back to Sensors and choose a ‘pitch gyroscope’ block and connect it on the left 0 of the ‘basic operator’
  19. Change the ‘pitch’ to ‘yaw’
  20. Click on the right 0 of the ‘basic operator’ and change the value to 7.84
  21. Go back to Lights & Sounds and choose a ‘main LED’ block and add it under the ‘else’
  22. Go to Operators and choose a “colour from’ block and add to the colour on the ‘main LED’ block
  23. Go to Sensors and select a ‘main LED’ block and connect it to the colour shown after ‘colour from’ is written.
  24. Go back to Operators and choose a ‘basic operator’ and add to the 0 after ‘channel of’ is written
  25. Again change the + sign to a /
  26. Choose a ‘square root’ block and connect it to the left 0 of the ‘basic operator’
  27. Change the ‘square root’ to ‘absolute value’
  28. Go back to Sensors and choose a ‘pitch gyroscope’ block, connect it to the 0 after ‘absolute value’ is written, and change the ‘pitch’ to ‘yaw’
  29. Go to the right 0 and change the value to


Magic 8 Ball


Like a real Magic 8 Ball, when the Sphero is shaken it will give you a random answer. These answers will be given through a sequence of 2 different colours.


Yes- Green

No- Red

What did you learn?

I learned that robots can be programmed using blocks and texts as codes. I also learned different ways to use block coding to create a program or even just to change the LED lights on the sphero.

I also learned that making a game is difficult but it was somehow fun even though there is a lot of coding and instructions included. 

What will you do next time?

Next time I will create a game that is easier and also work in the time given.

I did not get to finish my whole game, because halfway through my original plan I realised I was having trouble with the codes for a certain program and so I changed my plan. Next time I would stick to something I feel would be a bit easier for me.




No comments:

Post a Comment

Note: only a member of this blog may post a comment.