Major Tom
Posts: 66
Joined: Wed Feb 03, 2016 8:13 am
Location: Strung up in heavens high.

My Raspberry Pi class

Thu Apr 07, 2016 11:49 am

Hello everyone,

I thought I'd post a bit here about what I have been doing with Pis and schoolkids. Partly to let other people see what I have done, and partly to give people a chance to point out what I could do better.

The launch of the Pi 3 coincided with my school deciding that a computer programming class would be good, and yours truly would be the ideal person to spearhead it.

I work in a middle school, with students from about age 12 to about age 15. The school has no specific focus (arts/music/sports or technology), nor does it recruit only a certain type of student. It's an ordinary school.

So far we are in week 4 of my cobbled-together-one-evening syllabus. I teach two 90-minute classes a week, and I have 18 students and 4 other teachers who want to learn about the Pi.

The first lesson was a wash. I'm calling it lesson 0. We didn't have a room. And we didn't have any Pis. I was determined not to buy Pi 2s because the Pi 3 had just become available. Unfortunately our local supplier didn't have stock yet. So lesson 0 was all about how cool everything was going to be. At least, that's what the students thought. I was thinking about the syllabus I hadn't written yet.

The next week we got Pis! But cases were out of stock. I was trying to get things done as cheaply as possibleaffordably, so I specified the cheapest case, the cheapest keyboard and mouse, the cheapest HDMI cable, but... I splashed out on 3M branded power supplies with two USB outlets rated at a combined total of 3.1A. Power problems are the bane of the Pi, so I hope to avoid them. I also made sure we bought HDMI-HDMI cables and an additional HDMI-DVI adapter, which gives a little more flexibility than just HDMI-DVI cables.

I cringed when I saw that the Pis had arrived and been given to the students. I asked them to keep them in the anti-static bags, but you know what kids are like. Unfortunately lesson 1 was also a wash as we were moved to the ironically-titled PC classroom, which was mostly full of broken equipment. No PC for the projector. No whiteboard. So I did my first lesson by simply waving a Pi around and talking about how cool everything was going to be. Eventually my co-teacher (the science teacher, who also got roped into this, because computers are science, right?) found a working PC and we got the projector going. I was able to show how to use win32diskimager to write the OS file to the SD cards. I then realised it was going to take a while to write 18 of them (I had already done the teachers' cards). I took 7 cards home at the end of the lesson.

So that was week 1 and week 2.

Week 3's class involved getting everyone's SD cards written, and assembling the cases (which arrived that day). I got the clear acrylic cases with 4 tiny screws to hold the Pi in place. I didn't have enough screwdrivers, but that didn't really matter.

I was determined to let the kids do their own thing, so they put the screws in and assembled the cases. Some kids got their SD cards to boot and plugged them in to the monitors in the PC classroom, some of which worked. Certain combinations of certain Pis and certain monitors didn't work. In the end I decided two Pis were faulty (they booted, but had no HDMI output), so they were sent back to the supplier, and the science teacher and I gave our Pis to the students that had had them.

The second class that week was the first time we got all Pis booting. All working. And all ready to go. So, we covered the basics of plugging everything in, expanding the filesystem, and looking at text mode and graphic mode, and starting up with and without a password. We also talked about backups (we should have them!) and shutting down safely. I insisted that the students bring a notebook to class to write down stuff they thought was interesting, and what they did to break things, and how they fixed it. I don't think they'll be very rigorous about that.
My circuit's dead, there's something wrong.

Major Tom
Posts: 66
Joined: Wed Feb 03, 2016 8:13 am
Location: Strung up in heavens high.

Re: My Raspberry Pi class

Thu Apr 07, 2016 12:36 pm

So, that last post was a little long, but not as long as the eternity you experience when standing in front of a group of excitable kids expectantly waiting for something cool to happen.

My syllabus vaguely starts with "Introduction to Pi", "Introduction to Programming", "Introduction to Blinkenlights", "etc."

Only two of the students had ever done any programming (they used Arduino for a science project last year). The rest were completely new to the idea. My plan, such as it is, is to start with Sonic Pi, then Scratch, then maybe Python (using PyGame as a visual medium). I don't expect to teach the students how to be great programmers in 6 months, but I do want them to get used to the idea that they can bend the computer to their will and make it do stuff. And not to freak out when it doesn't do quite what they wanted.

So, week four, Sonic Pi lesson 1!

I am grateful to the Sonic Pi team for making the lesson plans available. I like the idea that Sonic Pi is a programming environment that gives the students instant feedback, and that they can try doing things immediately without knowing anything beforehand. I told them to bring headphones, but of course some didn't. I had some spares, but only a few. Headphones (or, more commonly, cellphone ear buds) do work when plugged into the Pi A/V socket, despite what you may have, er, heard.

Lesson 1 has a simple activity where a line of students is given a 'program statement' card each. The order of the cards is the program, and a single 'control' card is handed to the first student in the line. When a student gets the control card they perform the action on their program card and then pass the control card to the next student. This illustrates the idea of the computer executing a program as a sequence of simple steps, one at a time.

So, in week 4, 10 students and 4 teachers watched 8 students saying 'ping', 'woosh' and 'beep' as my simple program was run before their eyes.

Shortly after, 18 students and 4 teachers plugged their Pis together, booted them up, found Sonic Pi and started it, and entered their first computer program:

Code: Select all

play 60
I saw smiles all round the room when they clicked 'Run'.

Their second program was:

Code: Select all

play 60
play 64
play 67
which makes a nice chord, leading to even bigger smiles, followed by:

Code: Select all

play 60
sleep 1
play 64
sleep 1
play 67
which intuitively illustrates the function of the sleep command.

I pointed to the '1' in 'sleep 1' on the projector, which was showing the program, and asked "Can anyone tell me, what is this number?" Upon reflection I shouldn't have been surprised to hear "It's 'one'." What I meant to ask was "What does this number mean?", which of course led on to getting the students to experiment with different values.

I followed the lesson plan fairly closely, and it gives a lot of opportunities to encourage students to try things out, and to elicit answers about what they are learning, which makes a very interactive class, even with only two Sonic Pi commands.

I was a bit worried that the students might be interested in what Sonic Pi could do, but lack any musical skill, ability, or inclination to get it to do something. So I printed the sheet music from a simple tune ('Ode to Joy', from our old friend, Ludwig van), a lookup table of Sonic Pi notes, note durations, and note names on a musical stave. This turned out to be a master stroke as the students immediately had to encode it into Sonic Pi instructions.

The second lesson that week was spent on Lesson 2, which introduces the idea of debugging and iteration. Again, a useful lesson which is simple enough, but introduces important concepts in an accessible way. The students also started looking at the help and discovering more commands to try out, which was great to see.

I'll write more later after we have done more lessons. Or unless someone asks me to stop.
My circuit's dead, there's something wrong.

Forris
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 242
Joined: Fri Jan 06, 2012 7:46 pm

Re: My Raspberry Pi class

Fri Apr 08, 2016 9:18 am

Great to hear what you're doing! I've just started introducing Pi's to my son's school, although I'm not a teacher, just an enthusiastic parent with some spare time. Also, the school is a Primary, and I'm initially working with the Digital Leaders group, which consists of 10 kids aged from 7 to 11 ( with only 2 boys ) and a very keen teacher who's standing in for the IT teacher ( while she's on maternity leave ).

As this group only meets one lunchtime a week, and I can't do every week, time is an issue. As a result, instead of starting at the beginning, I've chucked them all into, if not quite the deep-end, then at least somewhere near. Our first 2 sessions involved them working in pairs, breadboarding a simple circuit with 2 buttons and 2 leds in the first session, and then coding a reaction game, using the circuit, in Scratch, for the second session.

The school currently only has 1 Pi, which it was given as part of a film festival that they took part in last year. The point of my sessions at the moment is to get the kids enthused about Physical Computing, so that they can influence the school into getting more Pi's. I am currently using my own supply of Pi Zeros for the classes. Both the IT teacher and her stand-in are really keen to have a section of the Computing room designated to Raspberry Pi's. I have managed to get some monitors from a local company that was changing their equipment, so we can have a permanent setup.

I really enjoyed running the sessions, and all the kids were engaged and keen to learn more, and by the end of the second session they were coming up with their own enhancements. Having read your posts, I have a couple of questions/observations:

Was there any particular reason why you started with Sonic Pi ? To me, it seems a little odd to start with a text-based environment, and then go to on to Scratch. In our school, the students are introduced to Scratch in Year 3 (age 7+), having used Espresso in Years 1 & 2, so that seemed to me to be the best place to start, taking an environment that they are familiar with on PCs and showing them what you can do when you add GPIO in to the mix.

You have said that you held off on buying Pi2's in favour of the new Pi3. Do you see a benefit in schools for the 3 over the 2 (or even the A+ or Zero) ? Are you looking to use them as full-blown computers, or mainly to experiment with ? I like the idea of the Pi3, but am unconvinced of it's role in schools, as opposed to the previous models.

Keep up the great work, and I look forward to reading more in the future.

User avatar
piglet
Posts: 872
Joined: Sat Aug 27, 2011 1:16 pm

Re: My Raspberry Pi class

Fri Apr 08, 2016 10:15 am

@Major Tom, thank you for your posts. I found them quite moving. More please :)

Major Tom
Posts: 66
Joined: Wed Feb 03, 2016 8:13 am
Location: Strung up in heavens high.

Re: My Raspberry Pi class

Sat Apr 09, 2016 9:41 am

Forris wrote:I really enjoyed running the sessions, and all the kids were engaged and keen to learn more, and by the end of the second session they were coming up with their own enhancements. Having read your posts, I have a couple of questions/observations:

Was there any particular reason why you started with Sonic Pi ? To me, it seems a little odd to start with a text-based environment, and then go to on to Scratch. In our school, the students are introduced to Scratch in Year 3 (age 7+), having used Espresso in Years 1 & 2, so that seemed to me to be the best place to start, taking an environment that they are familiar with on PCs and showing them what you can do when you add GPIO in to the mix.

You have said that you held off on buying Pi2's in favour of the new Pi3. Do you see a benefit in schools for the 3 over the 2 (or even the A+ or Zero) ? Are you looking to use them as full-blown computers, or mainly to experiment with ? I like the idea of the Pi3, but am unconvinced of it's role in schools, as opposed to the previous models.

Keep up the great work, and I look forward to reading more in the future.
Thanks for your comments, and it's great to hear you are giving the students new opportunities. I'll add some notes here to make things a little clearer and hopefully answer your questions.

Regarding Sonic Pi and Scratch, I am not intimately familiar with either, but I was aware of them, and that they are great for introducing students to programming. I had very little time to prepare a year's syllabus, so I hunted around for what other people were doing and what was working and what wasn't. Sonic Pi, Scratch, and Python were the usual suspects. I decided that Sonic Pi was the most "immediate" environment for the students. Whatever we did, we'd have to spend some time getting the Pis running (downloading OS, plugging stuff in, etc.) I could have done that myself, and screwed all the Pis into their cases, but I wanted the students to experience it. After that I wanted the students to be able to do something that was essentially instant, as a pay-off for the hard work of getting their Pis to a bootable state.

As I said, all but two of the students had never written a program, but Sonic Pi allows them to write a simple command and get a response. It's immediate, and it's obvious that what they did caused something to happen. It is a text-based environment, but since real programmers use vi* they'll have to encounter that sometime.

Sonic Pi will allow me to introduce linear program execution, iteration, branches, loops and functions. All with the help of Ludwig van. The students haven't seen Scratch before, but I hope they will make the connection between the graphical programming elements in Scratch and the text-based programming structures of Sonic Pi. I want them to experience both styles of programming, but I think they've already seen too much point-and-click.

Regarding the choice of Pi 3, the students paid for their own Pis and SD cards. The school paid for power supplies, cases, keyboards, mice, and HDMI cables. And provided the monitors. The monitors were in the original PC lab, which seems to be mostly defunct. I checked they had DVI inputs before going ahead, otherwise that would have been a huge expense. So, I recommended that the students should buy Pi 3 because it made sense for them to own whatever was current (plus they then don't have to buy a WiFi or Bluetooth dongle). Local suppliers have Pi 2 and other models available with a discount now, but no-one has any Pi Zeros, of course.

Actually, upon reflection, if I had bought 24 Pi 2Bs and then the Pi 3 was released I'd be a little put out. I know that this has happened to people in the past, and I know and understand completely the reasons for it, but I am happy that it wasn't an issue.

I don't know the students' home situations, so it's quite possible some of them don't have a PC. The Pi 3 is actually usable as a PC in many respects, so I hope the students will be able to use them for other purposes too.

I'm very happy to get comments questioning my choices, but I think they're not so bad. After a couple of months I should know if I did it right, or if I should have done something better. I'll write about it here so that other people can learn from my mistakes.

*or emacs
My circuit's dead, there's something wrong.

timrowledge
Posts: 1138
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: My Raspberry Pi class

Sun Apr 10, 2016 3:20 am

Don't forget that with Scratch the kids can do exciting things with stuff connected to the gpio pins - like turning LEDs on, reading switches, triggering nuclear reactor melt-downs etc.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

Major Tom
Posts: 66
Joined: Wed Feb 03, 2016 8:13 am
Location: Strung up in heavens high.

Re: My Raspberry Pi class

Sun Apr 10, 2016 5:48 am

timrowledge wrote:Don't forget that with Scratch the kids can do exciting things with stuff connected to the gpio pins - like turning LEDs on, reading switches, triggering nuclear reactor melt-downs etc.
Ah, yes, that will be in the "Introduction to Blinkenlights" part of my syllabus.
My circuit's dead, there's something wrong.

Forris
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 242
Joined: Fri Jan 06, 2012 7:46 pm

Re: My Raspberry Pi class

Sun Apr 10, 2016 8:41 pm

timrowledge wrote:Don't forget that with Scratch the kids can do exciting things with stuff connected to the gpio pins - like turning LEDs on, reading switches, triggering nuclear reactor melt-downs etc.
And hopefully, ultrasonic sensors and servos soon, too ? ;)

Forris
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 242
Joined: Fri Jan 06, 2012 7:46 pm

Re: My Raspberry Pi class

Sun Apr 10, 2016 8:53 pm

Thanks for the reply, MT. Just out of interest, what country are you in?

Interesting idea, getting the students to buy their own Pi's, which makes much more sense for them to get Pi3's. And your reasons for starting with Sonic Pi sort of make sense to me now, too, especially if this is their first contact with any programming environment. As I said, I started with Scratch because the kids already know the environment and the basics, I'm just showing them how to do cool stuff with it! Also, I haven't really looked at SonicPi yet, partly because I have no musical knowledge and partly because we don't have speakers for our setup yet, as the monitors are DVI, and the children work in pairs, so headphones aren't really an option.

Major Tom
Posts: 66
Joined: Wed Feb 03, 2016 8:13 am
Location: Strung up in heavens high.

Re: My Raspberry Pi class

Mon Apr 11, 2016 10:31 am

Forris wrote:Also, I haven't really looked at SonicPi yet, partly because I have no musical knowledge and partly because we don't have speakers for our setup yet, as the monitors are DVI, and the children work in pairs, so headphones aren't really an option.
No musical skill is required. Follow the lessons that I linked above, which introduce programming concepts in an accessible way. Or if the students already know about conditionals, loops, etc., then follow the Sonic Pi tutorial so they can make cool sounds.

I am focusing on the lessons, not the tutorial, because I want the students to see what programming is made of. In two weeks or so we will move on to Scratch, and I am hoping they will see the same structures there that they just learned about. Some of the students have already started playing with Scratch, but I am limiting the speed of the class so that all students have a chance to keep up.

I found in my class, when the students forgot their headsets they would share. And two students can work on a single Pi by having one earbud each. A lot of the time they will work around problems, and they only need help when they are stuck.
My circuit's dead, there's something wrong.

timrowledge
Posts: 1138
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: My Raspberry Pi class

Mon Apr 11, 2016 3:45 pm

Forris, yes I have servos and ultrasonic working in the lab. Soon.
Tom, pair working can often be more effective than "one computer per child"; worth sometimes specifying it. Have you ever read anything about 'extreme programming'?
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

Forris
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 242
Joined: Fri Jan 06, 2012 7:46 pm

Re: My Raspberry Pi class

Mon Apr 11, 2016 4:07 pm

timrowledge wrote:Forris, yes I have servos and ultrasonic working in the lab. Soon.
Tom, pair working can often be more effective than "one computer per child"; worth sometimes specifying it. Have you ever read anything about 'extreme programming'?
Thank you, thank you, thank you :D :D :D :D :D :D :D

Forris
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 242
Joined: Fri Jan 06, 2012 7:46 pm

Re: My Raspberry Pi class

Mon Apr 11, 2016 4:16 pm

timrowledge wrote:Forris, yes I have servos and ultrasonic working in the lab. Soon.
Tom, pair working can often be more effective than "one computer per child"; worth sometimes specifying it. Have you ever read anything about 'extreme programming'?
That's what I am finding, Tim. The group that I am helping with comprises 2 kids each from years 3 - 5, and 4 from year 6, so they almost naturally drift into pairs themselves. I find it also helps with keeping a discussion going, as one of the pair will do something or suggest something that the other didn't know and as they are working together there is a automatic sharing of ideas. If they work solo, you can find that someone has pushed ahead without you noticing, and without the others learning from it.

Also, pairing up means less resources and they occupy a smaller area, which makes it easier to manage.

My other thought, MT, is that sharing earbuds is not particularly hygienic.

Forris
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 242
Joined: Fri Jan 06, 2012 7:46 pm

Re: My Raspberry Pi class

Mon Apr 11, 2016 4:17 pm

Forris wrote:
timrowledge wrote:Forris, yes I have servos and ultrasonic working in the lab. Soon.
Tom, pair working can often be more effective than "one computer per child"; worth sometimes specifying it. Have you ever read anything about 'extreme programming'?
Thank you, thank you, thank you :D :D :D :D :D :D :D
P.S. Nice to see your comments on Simon's blog, Tim. Sorry if my reply was a bit harsh.

Major Tom
Posts: 66
Joined: Wed Feb 03, 2016 8:13 am
Location: Strung up in heavens high.

Re: My Raspberry Pi class

Thu Apr 21, 2016 9:56 am

Hello again,

Well, the students have a test coming up, so I have only one more class then a short break.

I finished the Sonic Pi lessons. There are 5 of them and each one files one lesson slot. Lesson 3 introduced the random function and the if statement.

The biggest problem I found with lesson 3 is that Sonic Pi's rand function isn't actually random. Like most computer languages it's pseudorandom. Not only that, the random seed is the same for every run. This means that every time you run the program you get the same "random" sequence. So every student who ran the example script saw the same sequence of notes every time they ran it, which was the same sequence as all the other students. It was hard to explain this, but I think I got away with it.

This meant that teaching conditionals lost some of its sparkle as the behaviour of the code was predictable. Simulating a coin toss is no fun when you know what the result is going to be. Never mind.

Lesson 4 is concerned with data structures. I thought that the use of a list was a bit of a stretch, but we followed the bubble sort example with a row of students holding numbered cards and it worked. I demonstrated the algorithm in plain English to show how it relied on only simple instructions, and I elicited from the students why it has the name "bubble sort".

Lesson 5 introduces concurrency. It is useful for the students to see the difference between linear programs, and concurrent threads. The proposed illustration using student volunteers and action cards sort-of worked, but it was tricky to set up. However, since different learning styles are better for different students it is worth trying.

I'll continue this review in the next post. I want to split it here as it's getting too long (again).
My circuit's dead, there's something wrong.

Major Tom
Posts: 66
Joined: Wed Feb 03, 2016 8:13 am
Location: Strung up in heavens high.

Re: My Raspberry Pi class

Thu Apr 21, 2016 10:20 am

Hello again,

I was a little worried that the students were getting a little bored with Sonic Pi, especially in lesson 3 when some students were confused with the behaviour of the random function. The lessons are quite lively, and students are happy to play with Sonic Pi (and Minecraft, and Python Games, and Scratch, and whatever else is on the typical Raspbian image). I do want them to focus on what we are doing, but I also want them to explore and discover things. So far we have not connected the Pis the to internet, which has meant there is very little distraction.

To round things off I wanted something cool for the students to try. I found the Sonic Pi Live and Coding website (http://www.sonicpiliveandcoding.com/) and there there was a Sonic Pi version of Daft Punk's Get Lucky, which is downloadable as a text file. I thought this would be cool for the students as it sounds good and it contains a lot of the things we studied in the lessons. But, how to get the file to the students.

We have no wifi in the computer room. I may have mentioned that most of the stuff in there is junk. There is a wired network, but I need to get administrative help to attach 23 Pis to it. There is wifi in the science room, which is where we were supposed to be. What to do?

It so happens that I have built a Rachel Pi, which is a Pi with wifi dongle configured as a standalone wifi access point (AP). On the Pi's SD card is a bunch of wikipedia pages, books from Project Gutenberg, and some videos from Khan academy. It is intended to make such teaching material available to schools in places where there is no internet. Cheap smartphones or tablets can be used to connect to the Pi and view the content.

Anyway, I put the Get Lucky file on the Rachel Pi SD card and asked the students to connect to the Rachel Pi AP. They were able to cut and paste the contents of the file to Sonic Pi and make it work. And they weren't able to surf the web and get distracted. And it sounded cool. And they could look at the code and understand it. Remember, all but two of the students had never programmed before, but they now all know how to set up a Pi from scratch and use it to make music.

Incidentally, it seems that connecting 23 Pi 3s to a Rachel Pi (based on a Pi 2 with a wifi dongle) is possible, if anyone is interested. I thought the Rachel Pi would choke or fail in some way, but it was fine.

Next class might be introduction to Scratch, or it might be connecting the Pi to the internet, if I can get wifi set up. We need to see how to download stuff so the students can experiment during the break (after the exams, of course).
My circuit's dead, there's something wrong.

User avatar
morphy_richards
Posts: 1603
Joined: Mon Mar 05, 2012 3:26 pm
Location: Epping Forest
Contact: Website

Re: My Raspberry Pi class

Fri Apr 22, 2016 1:48 pm

This is all brilliant stuff! I love reading this, please never stop sharing!
:) :) :)

Gbaman
Posts: 141
Joined: Mon Jan 21, 2013 2:43 pm

Re: My Raspberry Pi class

Sat Apr 23, 2016 11:41 pm

This is great stuff! Keep it coming, is great to hear how you are getting on.

On the off chance might be useful, may want to have a glance over at PiNet - http://pinet.org.uk. Was specifically designed for schools to help manage a stack of Pis in a classroom.
Only deal breaker for this project may be is can't take the cards with PiNet loader on them, home as they network boot off the server. Operating system isn't stored on the card.
Lead developer of PiNet, a free and opensource centralised user accounts and file storage system for Raspberry Pi classrooms used in over 200 schools across the world.
http://pinet.org.uk

Major Tom
Posts: 66
Joined: Wed Feb 03, 2016 8:13 am
Location: Strung up in heavens high.

Re: My Raspberry Pi class

Sun Apr 24, 2016 11:37 am

Thanks for your comments. I know it's a niche activity, but if someone is thinking about having a go, then don't be afraid to wade in. It's tempting to think you have to plan everything to the tiniest detail, but if you already know how to use the Pi and fix common problems you will have no problem getting the students unstuck. As illustrated by my posts.

I am aware of PiNet and I would like to use it, but indeed I want the students to take their Pis home. It would be ideal if we were going to re-vamp the computer room and replace all the beige boxes with Pis (and one of the old PCs could be the PiNet server).

This class is pretty much seat-of-the-pants teaching. I have an overall goal, but no clear plan to achieve it. In other words I have the picture from the front of the jigsaw box, but I seem to have an awful lot of pieces missing.

Tomorrow is going to be (brief) introduction to Scratch, then brief introduction to apt-get. I don't think I will be able to set up WiFi, but I could use my smartphone as a hotspot and show them how to get a couple of (small) packages. If all the students try to update and upgrade my phone will probably melt.

Incidentally, one of the students has already coded up a tank game in Scratch, so I might have him lead the next couple lessons after the exams. He's way ahead, but it's not fair to slow him down, and I will definitely encourage him to help the others.
My circuit's dead, there's something wrong.

Major Tom
Posts: 66
Joined: Wed Feb 03, 2016 8:13 am
Location: Strung up in heavens high.

Re: My Raspberry Pi class

Wed May 11, 2016 6:46 am

Hello again,

Last week the students had a test, so there was no class. I didn't want to start a new topic before the test, so I demonstrated apt-get and told them to have a short play with Scratch. I used my phone as a wifi hotspot and it worked fine for downloading some funky fonts and a small application to illustrate how to search and how to install packages. I did not try apt-get update and upgrade, I am pretty sure that would eat all my data for this month if the whole class did it.

I scrounged a wifi router for later on, which I hope to configure in place of one of the old PCs. We use fixed IP addressing here, and it's tedious to get a new device onto the network, let alone a batch of 25 devices. I will copy the donor PC's IP address and network settings for the router and hope that it will do the right thing with all the Pis on the wifi side trying to get to the network at large on the wired side. My backup plan is to install a wifi dongle in the instructor's PC and use windows network connection sharing to share the wifi and bridge it to the main network. What a drag.

Anyway, I didn't have a plan for the first look at Scratch, so quickly I showed Scratch the Cat moving forward by n units and turning right by m degrees. Then I showed pen up and pen down and drew a square. Finally, I told the students to draw a five pointed star, expecting that would take them a while. Some creative students got Scratch Cat to swear, so I was inwardly pleased but outwardly annoyed.

The students and teachers are not very tidy with setting up and shutting down their Pis. I keep having to re-iterate "first HDMI, then power". I have been quite lucky that the Pis that booted in TV mode didn't die when I pulled the power to reboot them. One of the teachers was looking puzzled at this and pulled out the SD card while the Pi was powered. You can imagine the look of horror on my face. The SD card was corrupt, so I re-imaged it and gave it back. I also have one desk with only one electrical outlet free. Fortunately the power supply I specified has two USB outputs and 3.1A capacity, so it is possible to power two Pis from it. Unfortunately the students are not careful when pulling their cable out again and sometimes affect the other Pi.

Anyway, this week was the first time we got to make a "proper" Scratch program. While I am an experienced and versatile programmer I do suck at thinking about what students might be interested in. Luckily I found this:
http://scratched.gse.harvard.edu/resour ... -confusion

Thanks Katie for posting that. Students love soccer. Why didn't I think of that?

I covered the design points in the same order as Katie wrote about them, which made things pretty smooth. I was worried that we'd do the whole thing in an hour, but actually we took it slowly and made sure the students knew the general purpose of each code block as well as why it was chosen for this step of the program. We covered lesson 1 & 2 in the first session, then 3, 4 and 5 in the second. I added a way to detect if the ball was saved by the goalkeeper, and only update the score if it was not.

The students loved it. They kept up with what was going on, and quite quickly they started changing it to do what they wanted, which was what I was hoping for. One of the teachers wanted the characters to say "Goal!" when a goal was scored, so I suggested a broadcast message and he immediately understood. I also noticed quite a few students making a two-player version, and others spending time with the paint utility making their own icons and characters for the game.

One of the teachers had taken his Pi home and edited some files to do something with wifi. It should not have been necessary, and he broke it anyway. I could have spent some time figuring out what he did, but instead I decided to re-image it because it's the quickest way. I told him to make a note of what he did next time, and also make a copy of whatever files he changed so that he could revert it later. I hope he remembers.

Sorry for such a long post. Next week we are doing a Bubble Sort in Scratch (because we did a humans-and-paper demonstration of Bubble Sort as part of the Sonic Pi lessons). Thanks for reading.
My circuit's dead, there's something wrong.

Major Tom
Posts: 66
Joined: Wed Feb 03, 2016 8:13 am
Location: Strung up in heavens high.

Re: My Raspberry Pi class

Sat May 21, 2016 7:16 am

Hello again,

I get two lesson slots every week. This week we wrote a bubble sort in Scratch. Or rather, I wrote a bubble sort in Scratch and the students copied me. I repeated the 'physical' demonstration from the Sonic Pi lesson, with a line of volunteers holding numbered cards, then proceeded to show how to make a list and iterate through it.

The students don't yet have the concept of breaking down a task into tiny (tiny!) parts to make the computer do what they want, but I think with enough examples they'll figure it out. My hope is at least they'll have no fear of trying things out and making mistakes.

I gave all the students a worksheet which stated the goal of the bubble sort and some hints for how to achieve it. One student did finish his pretty much by himself, so I think he's already onto it. The others copied me as I introduced each idea and incorporated it into the code.

Swapping two variables using a temporary variable seemed to be quite complex for the students, but I did another 'physical' demonstration and told two students they had to swap their number cards but they had to have one had in their pocket and they could only hold one card at a time. Of course it was impossible, so I called on another student to temporarily hold one card during the swap. I think this helped a lot of students to visualise what was going on.

I had written a working example the week before, but I got a bit sidetracked during the lesson and made a few mistakes. The students were as confused as I was when parts of the program didn't work. Luckily I made this into a teaching moment and introduced some debugging techniques (which we had seen in the Sonic Pi lessons) to figure it out. My brain empties quite rapidly when 22 pairs of eyes are staring questioningly at me.

Anyway, eventually all the students got theirs working. Several students made the mistake of swapping the list contents with the list index number, so when the program ran their list just got replaced with 2,3,4,5... They immediately saw what the problem was when I showed them where to look, and fixed it themselves.

Next week we're going to do a guessing game. This time they won't copy me. I'll show them something that works and ask them to work in pairs to do the same thing. Basically, computer chooses a random number, player enters a guess and computer says 'too high' or 'too low', and repeats until they guess correctly.

After that I am going to get the Pis all on wifi and introduce networking. One student already asked me if he can do something in Scratch on one Pi and have something happen in Scratch on another Pi. When I told him 'yes' he said he wanted to modify his Scratch tank game to work over the network (which I already knew was what he wanted).

After that I am planning to introduce Python and PyGame (so they can draw things), and some switches and LEDs. I have about $500 to spend, which will be just enough to get a breadboard, some wires, and some switch modules and LEDs, and maybe a few servos to share. Then they will have seen some different programming languages, some networking, and some blinkenlights. I want them to do something related to IoT, but that's such a nebulous term that it could mean anything. I am a little worried that Python might be a big step for them, but I have just discovered Node Red, which punches all the IoT buttons, so I might have a go with that instead. Anyone with some experience using Node Red with kids is welcome to chime in, especially if it's to say 'for goodness sake, don't do it!!!'.

Again, thanks for reading.
My circuit's dead, there's something wrong.

Major Tom
Posts: 66
Joined: Wed Feb 03, 2016 8:13 am
Location: Strung up in heavens high.

Re: My Raspberry Pi class

Sun Jun 05, 2016 2:01 pm

Hello again,

Well, the guessing game went much quicker than I expected. I had reserved two slots for it, but we were finished in one.

When I announced the challenge for the lesson I got a few blank looks, and some students were really unsure how to start. So I promised them one hint every 5 minutes. I had made a worksheet with a general outline of the solution in English (no code or commands), so I just showed the code blocks for each step in my outline.

Some students did complete the program by themselves, and I could tell they were pleased with what they had done. They then started to embellish the game by adding some sprites and background.

Because they did so well I brought forward the next lesson, which was networking. I already had a wifi box working in the PC room, so I made a short powerpoint about networking. It's really hard to explain everything as it's an extensive subject, but I boiled it down to: everything is connected to everything; everything has an address comprising of four numbers; if you know the other computer's address you can send stuff to it; if you put data into the network it will come out where it's supposed to, but we don't know or care how (in many ways just like the post office); people are terrible at remembering numbers so DNS converts names to numbers for us.

So, we all got on wifi, and we all learned how to find our IP address, and we all SSHed into our friend's Pi, and learned if they had or had not changed their password.

The last part of this lesson was sending data between Pis using Scratch mesh. Once I told them where the super-secret mesh menu was they set up a broadcast sender on one Pi and a receiver on another and stuff happened. Some students were amazed. Some were non-plussed as they were unsure what they had done. One student started making his tank game work over the network (as I knew he would...).

One small point. Two students managed to mess up their installation of Scratch early on. I couldn't figure out what they had done, so I used apt-get to remove and reinstall it. If you do this the mesh menu is no longer accessible (even if you press the shift key). Which I didn't know until that day.

As luck would have it, earlier on I was playing with Scratch on my PC. The PC version also does not have the mesh menu accessible until you do this:
https://wiki.scratch.mit.edu/wiki/Mesh

So, my students thought I was amazing as I conjured up arcane menus and did stuff to magically make their Scratch work just like their friends'.

There are only four slots left before the summer break. After the holidays we're going to play with switches, LEDs and other cool hardware. I got a small grant which I have to spend, so I'll get some Pi cameras, some motors, a couple of GPS receivers and a few other goodies that the students can play with, then they have to make an IoT science fair project to show to other people in October.

I can't get the extra hardware before then, so I'm going to expose the students to Python, using the Minecraft Pi lesson from the Foundation (thanks, Foundation). I hope they like it.
My circuit's dead, there's something wrong.

timrowledge
Posts: 1138
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: My Raspberry Pi class

Mon Jun 06, 2016 7:11 pm

There's something really wrong with your installation of Scratch if you had to do anything like the messing around in the browser described there - like you got an ancient version. I added simpler access to the mesh ... two years ago?
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

Major Tom
Posts: 66
Joined: Wed Feb 03, 2016 8:13 am
Location: Strung up in heavens high.

Re: My Raspberry Pi class

Wed Jun 08, 2016 5:58 am

timrowledge wrote:There's something really wrong with your installation of Scratch if you had to do anything like the messing around in the browser described there - like you got an ancient version. I added simpler access to the mesh ... two years ago?
Hi, thanks for your comment.

Here's what happened.

All students started with the same Raspbian installation in March, and we started using Scratch in late April. When it came time to turn on the mesh it all worked (press the shift key while selecting the Share menu). No problem at all. However, at some point before that two of the students had really messed up Scratch on their Pis. I don't know what they did, but when they started Scratch they just got a window outline with nothing in it, so it was no use.

To fix this problem for those two students I used apt-get to remove Scratch and then re-install it. The freshly installed version worked again, so everyone was happy, except a few weeks later when it came to turn on the mesh. For those two students the mesh options did not appear in the Share menu when holding down the shift key.

So, because I just happened to have discovered how to turn it on in the PC version (actually, it was here http://www.raspberry-pi-geek.com/Archiv ... using-Mesh that I found it) I tried the same thing on those two Pis, and it worked.

I suppose it would be repeatable by installing the March Raspbian and deinstalling and reinstalling Scratch. It may be a very niche bug because in most cases Scratch is available pre-installed and works as expected.
My circuit's dead, there's something wrong.

timrowledge
Posts: 1138
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: My Raspberry Pi class

Sat Jun 18, 2016 6:09 pm

I've worked out what you did wrong here; you loaded the 'scratch' package, which is the *old* stuff, rather than 'nuscratch'.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

Return to “Staffroom, classroom and projects”

Who is online

Users browsing this forum: No registered users and 2 guests