With Halloween just round the corner we decided to have a spooky last look at the Unicornhat but this time using Scratch GPIO. After playing around with a few example codes we set the club members the challenge of coding their own pumpkin. Myself and Mrs C stood back this session ( busy stirring our coding cauldrons) to see just what our coders could achieve.
We were not disappointed by the results, it was not long before every which way we looked, we had pumpkins flashing, growing and asking us questions.
Working in teams our coders had managed to take control of each pixel and determined whether they wanted it red/green/blue/magenta/cyan/yellow or white. They were able to invert colours, have them random, join pixels in rows, move all pixels up, down, left to right and change costumes. What was really interesting was nobody attempted using the advanced RGB hexadecimal number to actually create orange. I don’t think the pumpkins minded! I think it is safe to say that the Unicornhat from Pimoroni is a great little add on and has given us a few weeks of fun and developed our coding and debugging skills at the same time.
Thank you to Simon Walters of Cymplecy- simplesi.net for the examples.
Autumn Term 2015 Session 5
In answer to the question-only if it can be programmed to mark the books. Today we looked at the Maplin Robotic Arm working with a python script, which allowed us to control it using the arrow keys on our keyboard. We had great fun hacking the code to adjust the speed and became pretty good at getting it to pick things up. The highlight of course was when someone had the idea of getting the arm to control a pencil, and next came the question “Can we program it to do homework Miss?” Now there’s an idea, I guess anything is possible. Not only did we get to program the robot using the keyboard, we also used gestures to move the arm by using the Pimoroni Skywriter HAT thanks to the code written by Dan Aldred @TeCoEd – thanks Dan.
Using the gesture control was tricky as there was a longer delay in movement and it wasn’t as smooth but we still thought it was pretty cool.
Not satisfied with just the robotic arm we settled down to the task of debugging our Unicorn Hat rainbow codes from last week and after sorting out various updates, syntax errors and then running through Idle we had some very pretty colourful displays. However we were most impressed with the amazing pictures we created on Unicornpaint from Flags of the world, to Minecraft characters we even ended up with our very own matrix Raspberry Pi logo. Infact it was like a mini Blackpool Illuminations – just without being stuck in traffic.
Autumn Term 2015 Session 4
As promised this week we introduced the club to the Raspberry Pi official 7″ touchscreen and it soon made it to the top of our Christmas list. Over the next few weeks we will be using a couple of them alongside our normal monitor setups so we can see how versatile they are for classroom use. So far we like what we see. Of course the selling point to us is how quick and easy they are to move around from class to class and how little space you need for storage. The touchscreen is great for little fingers but certain things seemed harder to touch with bigger fingers. We have powered them a few different ways to suit what we needed. If we simply wanted to go on Minecraft we powered with one mains adaptor and 2 jumper leads to the screen, we then had great fun using a wireless remote keyboard. We also liked using the option of a micro usb to usb to power the screen, this way all the GPIO pins were available, however if we wanted to use a HAT this option did not give us enough power. Instead we used a separate supply to the Pi and another to the screen. We then used a Black Hat Hack3r from Pimoroni to break out the GPIO pins and attach a hat to.
Whilst some of us were having fun playing with our new toy others were hard at work doing some serious coding. We continued to look at the Unicorn Hat and introduced the meaning of RGB and HSV – who knew so much work went into making rainbows. We started to follow a Python code and each step of the way stopped to look at what we had written and what it meant, after all we need to understand what we are asking the program to run. At times it felt a little like a maths lesson but a fun one. Even with our new extended club time we ran out of time and had more than a couple of errors to debug, so for now we will sleep on it and continue to debug our code next week.
Autumn Term 2015 Session 3