my goal for sphero is that I get used to the code and not have to watch a video to make it do something new.
This is my first code: a square.
For the square we had to put 4 roll blocks with a delay in between. The first one had face 0 degrees, the second had face 90 degrees on it, the third had face 180 degrees on it and the fourth had 240 on it.
My next code: a triangle.
we made the triangle in the same way that we made the square but we had to do a little bit of maths. We had to divide 360 by 3 witch was 120 so we had 3 roll blocks. The first one was facing 0 degrees, the second was facing 120 and the third was facing 240. all of those together equals 360.
now we have started using the if, then, else block: toss and throw game.
for the toss and throw game the main part was the if, then, else block. We had to use the stabilization block for this code. We had to turn the stabilization off. in the if then else block we had to put a accelerometer block in the if then else block. if the total accelerometer was larger than 3 then it would show a green light and play a random animal sound, then you had to guess what animal it was. if you threw it less then 3 then a red light would come on. after 2 minutes of playing the game it would say game over to you.
My next program: the hot potato game.
in this program we started using variables. at the start of the code we had to turn he stabilization off. we had a speak block saying play the hot potato game, then we had a loop forever block with a set to variable block inside and a loop until block inside. inside the loop until block we had a main led red and a raw motor block left was set to 0 right was set 255 for 0.1 seconds. if the total accelerometer is bigger than 3 the it plays abrupt sound ad continues the code. then it played you lose sound when it expires and whoever is holding it loses.
the next program: spinning top
in the spinning top if you spin it clockwise the colour turns red. if you spin it anti-clockwise it turns green.
in this code we made it say hello world and then turn the colour to red and roll forward for 1 second by writing await speak (‘hello world’, true); SetMainLed to red await roll (0, 50, 2);
next we turned the program into a square:
in this program we did the same as the hello world program but added a loop, some sounds and a different colour. with this program we had some trouble with our program because we forgot a bracket in the place where we made it turn 90 degrees each time it completes a straight line. then it plays the winclassic sound at the end.
we didn’t get time to take a video of it working but here is our code.
next we made a disco ball with our sphero by using colours. for this we didn’t use a video to work out the code.
the code just makes it go from the colour red to orange to yellow to green to blue to purple to pink in a forever loop.