Wednesday, 31 July 2013

Raspberry Pi frustrations

I was really excited when we were given a Raspberry Pi at school to "do whatever you want" with. I was even more excited when we were given five more by OCR!
I didn't really get much chance to do anything with them until this week. We had bought some HDMI-VGA leads which promised to work properly with the Pi and I had checked the many videos out there on how to set them up.
I had a good clearout at home a few weeks ago, and had thrown out an old keyboard because I had a much better one to use, but of course it is a wireless keyboard so wouldn't work with the Pi.
A new keyboard cost me a full fiver from PC World, and then I plugged everything and booted up.
A red and green LED came on and it all looked good. The green LED flashed on and off and then... nothing!
After much searching through the web for help (and finding none, couldnt find out what a flashing green LED meant, just what the patterns of flashing meant), I unplugged everything and tried again. This time, I swapped to another power supply (same 1.2A rating), and my screen flashed and the other three LEDs came on and it looked to be doing something.
I'm sure it was busy, but I had no idea what it was doing because my monitor was blank.
I knew that I probably had to edit a config.txt file on the SD card, but as I was using NOOBS it was hidden in a partition and I couldn't see it on my Windows laptop.
After several hours of trying every trick I could find on the web, I changed monitor leads from the standard blue D plug VGA lead to a much older lead that had pin 9 missing (which is used to power the EEPROM in the monitor for plug and play purposes)
Success! The display eventually came on and I was able to install Raspbian and get the Pi to boot. The monitor kept going to sleep, and it took a few changes to the settings to get it all running, and even then I had an annoying reminder on the display nagging me to change the screen resolution.
I am no stranger to these kinds of issues, but I can see that this would be really frustrating for an inexperienced user.
Anyway, I went into the settings on the Pi and enabled SSH, then loaded Putty and Xming. You can find the IP address of the Pi by typing:
ifconfig
And then use this to connect to the Pi with Putty, fairly standard and easy to do.
Start Xming, then load Putty and connect to the Pi.
Once you have a Telnet session (in the Putty window), type
startlxde
This should open a window which lets you see and use the Pi desktop.
At long last, I can start to play!

Thursday, 18 July 2013

Getting Loopy with PHP

This lesson starts to extend the skills and knowledge that students will need to be able to use PHP to solve problems.
The lesson starts with a recap on where the files are all stored because this had been causing issues.
It then looks at variables, IF statements and various methods of control structure such as SWITCH, WHILE and FOR.
This "lesson" allowed students to work at their own pace over a four hour period.
I am planning on creating a "PHP recipe book" with a series of scripts for them to copy and try and some graded problems for them to practice with.
Many of these lessons need a pair of HTMLpages, one with a HTML form to input values that can be used on the second page.
This word document has both pages, with different coloured backgrounds so that I can refer to the "green page" or "red page"


Click here to download the Getting Loopy presentation
Click here to download the Getting Loopy worksheet

Using PHP

We are lucky at Horbury Academy to have a web server that our students can access. I have set them all up with an individual FTP account so they can post live web pages and use PHP running on Apache.
This double lesson starts to introduce them to actual coding but also how to upload files to the server.
In practice, syncing between local files, remote files, and the browser cache took the students a while and I would cover this in more detail in future.




 I chose PHP because I think t meets these criteria.
  • Simple to understand
  • Syntax is simple.
  • Powerful 
  • It is widely used in industry, so will be useful for the students later
  • Students can install PHP on their home computers using XAMP
One issue with PHP is that it isnt easy to use an "input" command. This lesson also covers HTML forms (in fact we did forms first)


Click here to download the Using PHP presentation

Click here to download the Creating Web Forms worksheet

HTML Tables

Following on from the HTML Basics lesson, this is a one hour lesson on creating a HTML table.
The lesson reinforces how important that it is to make correctly nested tables.

Click here to download the HTML Tables presentation.

Introduction to HTML

As I have chosen to use PHP as the programming language for OCR computing GCSE, we start with a quick look at HTML.
This presentation is designed to get them started with the basics of HTML. It does not cover more advanced topics such as setting the doctype, but will enable students to create a simple HTML page from scratch.
Click here to download the presentation.
As always, feedback on the resources would be great!

Introduction To GCSE Computing presentation

At the start of a new GCSE course, I like to give an outline of what we will be covering, how the work will be assessed and also a quick look at some of tehe topics.
We start our new timetable two weeks after the June half term, so we have about four weeks of lessons before the Summer break. This gives students the chance to change options if they don't like the course, and most years I gain some and lose some students (this year I lost two and gained three)
The presentation starts with a look at some "celebrities" from the IT world before looking at the OCR course in more depth.
Please add comments if you find this useful, or can see a way to make it better.
Click here to download the GCSE computing introduction presentation.

GCSE Computing Scheme of Work

It can be daunting to approach the planning for a whole new course and writing an outline scheme of work takes a lot of time and effort. This is my first attempt at a scheme of work for our OCR Computing course. I will update it as we go through the year, giving more time for harder topics and either planning extra activities or reducing the time allocation for the ones when we have finished a topic early.
We teach GCSE options in five lessons a week, two doubles and a single sixty minute session.
Ive allowed a generous amount of time to learn how to use PHP and covered all of the theory topics three times. This is an introduction, a second look and a revision session for each topic once the final moderation date has been reached.
Feel free to adapt, adopt and modify, but I would appreciate some feedback so I can make it even better for next year!
Click here to download the scheme of work in Excel format.