Thursday, 31 July 2014

Rewind and Start Again - and introduce a 3 year old!

After getting a little frustrated with the Pi camera module, I decided to go back to basics with the electronics and refresh myself using the GPIO and so on. I had bought the Adventures in Raspberry Pi book and had the electronics to go with it so I thought it would be good to work through it so I can then use it in my lessons next year.

I also thought it would be a great way to show my son, Henry, some different stuff on a computer, as he usually gets to watch my husband play Hearthstone or use some apps on the iPad (puzzles and colouring mainly for Henry - and Daisy the Dinosaur is a firm favourite). So to get him involved I put together the LED and button, and to get a photo of it working I got Henry to press the button for me, and he is now hooked on what it can do.

After the success of the button, I went ahead and put the marshmallow button together, looked on by the new puppy - name today has been Bard. I say looked on, but supported quietly under the table.

Marshmallows were dug out of the cupboard, and after wrestling them off Henry I managed to get one plugged in and off we went destroying them as we squished them. Henry got involved by replacing the  marshmallows after they got too squashed to use anymore. We also changed the python code to get it to say hello to him.

From the frustration of the other day, to having so much fun with my son, playing with the simple parts of the GPIO - roll on trying out the Jukebox project!

Monday, 28 July 2014

Very Frustrating!

We have just got a new puppy and I thought it would be great to make a puppy cam to see what he is getting up to at night, and recording an image every minute or hour.

After getting my Pi Camera Module, plugging it in, enabling camera doing the updates and so on, no luck. I can get power to the camera but it just hangs and won't take an image. Any Python program I run just creates an image with no data in it. I have been to all the usual places and tried out the solutions but having no luck!

Will be looking at using a webcam to see if I can get it to work. If anyone has any ideas about why my camera module in not working please tell me, my husband can't take much more of my swearing!

Friday, 11 July 2014

Success, one working robot!

After a fruitless day of trying to get the robot and laptop talking to one another, I gave it up as a bad job and blamed the school Wi-Fi for causing all my problems and decided testing at home would be easier.

Checked out the IP address of the Raspberry Pi, and then put everything back together to test it out, one swift run of PuTTY, entered the IP address, closed my eyes and waited.......

Opened eyes, nope still nothing going on......waited a little longer and........hurrah, the prompt for login details and success.

Quickly ran the test programs to see if everything was working correctly and was more than pleased to see that it was. Just need to sit down and go through it all now, but that can wait for another day.

Thursday, 10 July 2014

More Minecraft Pi and a Robot!

After the success of yesterday and the fact that I had promised my Sixth Formers some time on the Raspberry Pis I let them loose on the set of Raspberry Pis that I had in my room. Considering there were less of them, they managed to make my room far more messy than my Year 10s - no idea how they managed that!

Anyway, after the quick intro about - "Hey, this is a Raspberry Pi" and answering the many questions that they had, we were off! All plugged in and ready to go, the brilliant student booklet for Minecraft Pi and Python on one screen and the Raspberry Pi on another. What did I discover from this lesson? That the Sixth Form like to use the TNT block and try to make things explode in Minecraft! There were lots of experiments with the Python coding going on, and lots of comments of why we had not used this to help them learn Python at the beginning of the year! All the students were much more willing to play with the code and try out new things with more confidence than just coding in Python. Excellent feedback from the students and some food for thought for next year.

As an aside to all this, the students really did enjoy it as many of them returned over the course of the day to get the Raspberry Pis back out to have another go, and also brought other students along to have a look.

During the afternoon, a box appeared in the department, and much to my joy it contained a load of electronics stuff that I had ordered. Gathering up the robot kit, I took it home to sit down and assemble it for tomorrow.

Here is the kit, a quick check that I had everything, loaded up the instructions and I was off. Forty minutes later after realising that I had put the wheels on the wrong side of the plate and I was finished! No batteries in the house so I will take it back to school tomorrow to fit the batteries and have a play with it! Awesomely easy and good fun to do!

Wednesday, 9 July 2014

Hey! Year 10, this is a Raspberry Pi...

So, after a few weeks of playing around with my Raspberry Pi I had promised my Year 10 and Sixth Form that we would do something a little different in the last couple of weeks. Today, I took the plunge and not only ran 10 Raspberry Pis in class with my Year 10s, but also had my Head of Department do a lesson observation on it! My thinking was that I might as well go all in!

The lesson did require a little bit of preparation in terms of getting all the SD cards to have everything I would need on them, so a bit of time was spent making a nice image and then putting it onto the 10 cards, and testing the odd one just to make sure they would work.

I decided it might be a good idea to check the Raspberry Pi boxes to make sure that each one had a Pi (obviously!), SD card, Power cable, HDMI cable. At the end of the tally, I was two Pis short and 3 power supplies down - a cold sweat broke out! After searching the department all but one set was found, and it was discovered it had been borrowed by another teacher to work on at home, a quick scramble of bits and pieces and we had the 10 I needed for my lesson.

The lesson began....

A quick show of hands showed that most of Year 10s had not heard of or seen a Raspberry Pi, which I was a little surprised about. One swift introduction into what a Raspberry Pi is and what it could be used for and we were off, the students piecing together their kit and getting it booted up. After getting the students to save a python file in the correct location they were off, looking at the different programs and working out how they could adapt them to do something else.

By the end of the lesson, all students had managed to get a program to run (and one pair had managed to overwrite the file!) in Minecraft Pi and worked out what the Flower Path program did, which then became lava paths, sand paths you name it. I was surprised how well the students managed to get my room back into some sort of order, and everything packed away in one piece. At the end I could not believe how many had questions about what you could do with a Pi and if we would use they again next year - how could I say no to that much interest? So roll on next year for the Year 10 (to be Year 11) adventures in Raspberry Pi and roll on tomorrow for the Sixth Form getting a go!

And after all of that my Head of Department was really impressed at how well it went, and what the students managed to learn and produce!

Friday, 4 July 2014

Very bad Music Composition!

After the other day of not getting any sound out of my headphones I decided to bring in my USB headset from home to try out, plugged it in....held my luck.

I decided that I was going to be a bit more proactive about this today, as it was only 8:00am so I was feeling refreshed and ready to go. A quick Internet search and I found my answer, sort of, a fiddle with the configuration and forcing the headphones to give me sound, I was off, although very quietly. Second, even faster search and I had my answer, the number of little Post-it notes I have floating around in my Raspberry Pi shoe box (children's shoe box is a great size to keep everything Pi related in) is growing.

So, now I have sound and the ability to play with Sonic Pi, one swift round of Twinkle, Twinkle Little Star, and I was off. One awesome scheme of work in the bag thanks to the excellent lessons provided on the Sonic Pi website and through the "Adventures in Raspberry Pi" book, a nice combination to keep everyone happy in class, and it covers a lot of theory in secret - even better!

Phew! It's Friday, off to run the dogs at Flyball on Sunday in Derbyshire. Hmm, I wonder if I (someone) could make a better light system using Raspberry Pis.....

Thursday, 3 July 2014

Not Raspberry Pi but related.....

After Picademy, a few of us realised that we were on the same train home, so we got our heads together to attempt to put our project idea into action. Since then, school and work towards my Master Teacher qualification has taken up most of my time, however, I have had a quick chance to play with normal Scratch to try and work out the quiz code element.

We decided that it would be great to import the questions from a text file to start with as this would minimise code that needed to be put in for each question. I found that importing a text file was really quite simple and the instructions I found were very clear. I used the Scratch code I found to create a basic quiz that prompted for answers to be typed in. This worked fine, so now I needed to make it so the questions would be answered by a button press.

I created a couple of buttons and tinkered with the blocks, had a quick trip around a number of tutorials and bashed together a quick quiz. 

Not the most tricky of things to put together in the end, but I am hoping I can now add in the electronic side of it so the buttons are actual physical buttons! So, I will now return to messing with my breadboard and GPIO pins to see if I can get it to work. Fingers crossed that I don't blow something up.

Tuesday, 1 July 2014

GPIO Marshmallows and Jelly Babies

Attempt 1: Using Marshmallow as a Button

So 9:30 at night may not have been the best time to start fiddling with my Raspberry Pi, and especially as I decided to have a go at making a marshmallow become a button but throwing caution to the wind I pressed on. After ransacking the house for marshmallows and a paper clip I was ready to start, I think it might be worthwhile to use bigger marshmallows next time as the little ones squashed too easily. See photos for 'used' marshmallows - there were only so many that I could eat before feeling ill.

After successfully making the marshmallow register as a button when I squashed it, I decided to press on and try to add the keyboard in. This proved to be a little more complicated when I tried to test it all together as the structure of the marshmallow was just not up to the challenge. 

I finally dispensed with the marshmallow for the time being so I could concentrate on getting the program to work correctly. After a quick test I was ready to move onto creating the game in ScratchGPIO, quickly picking a sprite (as time was marching on and my eyes are already itching like crazy from hayfever.) I pulled the code together for a final test before calling it a night.

It worked, I am very happy with my quick journey into using GPIO with some everyday items, although, who knew it would be so hard to find a paper clip in the house?

Attempt 2: Jelly Baby Screams

Feeling pleased with my marshmallow attempt last night I decided to have a go at the screaming jelly babies. After picking up some jelly babies on the way to work, I was ready for the challenge, downloading the sound was easy enough but getting my headphones to work was a challenge that I just didn't have the time to battle with (thinking that using a USB speaker would be more productive!). So moving on I went and entered the code, after sticking my poor jelly baby with the paper clips (and having to listen to another teacher telling me it was a mean thing to do to a jelly baby) I was ready.

Ran the program, and there was an error - nooooooooooooooooooooooooooooooo, I have typed it in correctly! Run again, nooooooooooooooooooooooo, still the same error. Check the pins - yes, they are in the right place. Open code, compare.......wait a minute.....oops, missed a line of code, that would explain it. Run program again......success, my jelly baby may not be screaming but it is telling me to have a nice day. 

I rewarded the jelly baby by eating it.

Hmm, what to do next? My sixth formers are looking like the best guinea pigs to test all these things out!