Seven Segments of Pi (Part 8)

Part 8 – Count to 10 and Figure Eight My Pi!

Last week I talked about the technical and practical challenges of running Raspberry Pi Workshops in schools. This week it’s back to the fun of writing software! It’s about how pupils were inspired to come up with their own ideas and how I came up with a game to play on the Seven Segments of Pi! This Blog is entitled…

”Count to 10 then Figure Eight My Pi!”

When running the…

PiDice

…workshop some pupils realised that, whilst a normal dice has 6 sides, hence when thrown can only give a number up to 6, a PiDice does not have this limitation! A single digit Seven Segment Display can display any number up to 9. So some pupils modified their PiDice software to give a random number from 1 to 9.

When running the…

PiStopWatch

…workshop a single digit was more of a limitation. The StopWatch could only count to 9. But one pupil proudly said to me “I’m going to make my PiStopWatch count to 10!” I explained to him he would need a two digit Seven Segment Display to display two digit numbers but undeterred, he declared he was going to do it anyway! 15 minutes later he called me over. “I’ve done it Mr Hunt!” he said. I went over and saw his display showing the number ‘0’. He pressed the red PushButton and his PiStopWatch counted 1…2…3…4…5…6…7…8…9…then it displayed…

Seven_Segments_of_Pi_Unrotated_Displaying_10

…which when rotated 90 degrees looked like this…

Seven_Segments_of_Pi_Rotated_Displaying_10

He was right! He had made it count to 10! He had realised that having individual control of all seven segments meant he was not limited to just displaying conventional numbers. He could illuminate any combination of the segments…and he had realised that this combination when rotated 90 degrees looked like the number 10!

This was a wonderful moment! It prompted me to tell them about the hexadecimal numbering system, widely used in electronics and software as a shorthand way to write binary numbers, where the numbers 10,11,12,13,14,15 are represented by the letters A,B,C,D,E,F…and how these too can be displayed on a single digit Seven Segment Display so long as they are represented as A,b,C,d,E,F. Maybe because they now saw themselves as budding Software Engineers, they were fascinated to know about the way computers count!

When I first came up with the idea of using a Seven Segment Display to teach the basics of programming I quickly had the idea of making it act as a Dice or as a StopWatch, but I wondered if I could come up with a game. I think games are a great way to learn! In my STEM Ambassadors lessons I’ve come up with a dice game called “Numba Jumba!” to practice mental maths and a card game alternative to “Connect Four” called “Connect Ten to the Power Minus Four!” But how could I make a game using just Seven Segments?

I remembered my old…

scalextric

…set and how I started with an oval…

Scalextric_Oval

…then was given a few more curves and straights to make a figure eight…

Scalextric_Figure_Eight

So I imagined a single segment appearing to going round the display in a figure zero…

Seven_Segments_of_Pi_Figure_Zero

…and then in a figure eight…

Seven_Segments_of_Pi_Figure_Eight

It could be programmed as a ‘State Machine’ similar to the PiStopWatch. Sound Effects introduced in the PiStopWatch could make it sound like a game. Then if it were to randomly switch between ‘figure zero’ and ‘figure eight’ using the ‘Random Number’ function from the PiDice with the player having to press the PushButton when the centre segment was illuminated, it would become a game!

I asked my son, Matt Hunt who is a Car Designer, if he could come up with a cartoon character looking a bit like a Seven Segment Display to go with the game and whilst chatting to him in Munich via Skype he sketched…

PiSeg1

…which I christened ‘The PiSeg!’

Describing the single segment going round the display as ‘The PiSeg’ and the “nom, nom, nom” sound effect was it munching on a Raspberry I had the game…

Figure_Eight_My_Pi_without_Graphics

Next week in the final part of this series of Blogs I will describe the fun the pupils had writing the software for their version of the game (and return to the thorny issue of sound from the Raspberry Pi when using a VGA Adapter). This Blog will be called…

“Have the Audacity to make your own sound effects!…D’oh! There’s no sound!”

If you are interested in learning more about the Seven Segments of Pi visit my Web Site www.SevenSegmentsOfPi.com or watch the “Seven Segments of Pi” YouTube Video. You can also watch Carrie Anne Philbin playing “Figure Eight My Pi” at the CamJam, courtesy of Alex at RasPi TV.

NevilHuntPhoto_QuarterSize

Nevil Hunt
Innovations in Education

1 comment for “Seven Segments of Pi (Part 8)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.