Saturday, March 19, 2011

Possible return of the OOPic

One of the main themes in this blog is looking at available microcontrollers since the demise of the OOPic chip. My students and I have had some fun learning about the Arduino and the Parallax Stamp. Both devices have lots going for them but I missed the true object oriented nature of the OOPic. The IDE was able to portray these objects graphically and display the object properties in real time. I still use a number of OOPic controlled robots in my classroom. Some of the electronics is starting to fail. Perhaps this new Raptor will be available in time to replace the old boards.

Thursday, March 3, 2011

Analog to Digital

Some grade 12s are working with the 2 BASIC Stamp modules I have in my class. The 3rd group is working with an Arduino Duo. Both groups are experimenting with Analog to Digital conversion. The Ardiuno Examples-Analog lab made a good start. Adding my DSO Nano oscilloscope meant they could see exactly what PWM means and why the LED could be dimmed from 0 to 100%. On the Stamp the other groups were using an RC circuit to measure the value of a variable resistor. The Stamp even has a built in in RCTIME function to pull this off. This RC time method works well but I started looking for the analog inputs and discovered the Stamp has none! Christopher Vecchio's web page shows a good work-around for the Stamp.
Arduino Analog Inputs - 6
Stamp Analog Inputs - 0
Score one for Arduino!

Wednesday, February 16, 2011

Computer Engineering ABQ - First Day

This evening was day 1 of the OISE Computer Engineering ABQ course taught at EC Drury High School. I was energized to meet the talented and caring teachers taking this "First Ever" ABQ in this subject. As I suspected, the key theme will be sharing as we all come from diverse industry backgrounds and various teaching experiences. I will certainly hand off the teaching to those better qualified and will need to act as a coordinator as everyone follows their own path to becoming qualified. I think the class wiki will be fun and an interesting platform for sharing and delivering course materials. I look forward to reading everyones blog posts in the next few days and discovering their perspectives on day 1.

What's an ABQ? This is an Additional Basic Qualification course offered by the University of Toronto Ontario Institute for Studies in Education (OISE). An ABQ qualifies a teacher to teach a particular subject at a particular level.

Saturday, January 29, 2011

Great Summative project

The first semester courses are done and I'm looking forward to posting more often during the second semester. All of my senior classes this semester were Computer Studies (programming) and so most of my thoughts have been focused on programming rather than technology.
The seniors capped off the year writing a version of the old Snakes and Ladders game. The program had to use a GUI input and show the postion of the players (person vs computer) by printing out the board, a grid of numbers, with symbols showing the player positions.

Printing out the game board lends itself to using a 2 dimensional array, lets call it board.
board[j][i] where j represents the row and i represents the number in the row. If all the rows in a Snakes and Ladders game counted up from left to right then it would be easy to fill up the array with a nested loop. The outer loop counts from zero to 9 - the rows. The inner loop counts from 1 to 10, 11 to 20, 21 to 30 etc to fill up the rows.

int i, j
for (j = 0; j<=9; j++)
{
for (i = 1; i<=10; i++)
{
board [j][i] = j*10 + i;
}
}

But in reality the Snakes and Ladders board counts up in a serpentine fashion so that 11 is above 10 and 21 is above 20 etc. Writing the code for the Snakes and Ladders board is only a little more complicated. The odd rows count up and the even rows count down.

for (int even = 0; even <=8; even +=2)
/** This for loop fills up rows 0, 2, 4, 6 & 8
* in the array. These rows represent
* the rows that count up from left to right**/
{
for (i = 0; i<=9;i++)
{
board[even][i] = count;
count++;
}
count+=10;
} // even
count = 11;
for (int odd = 1; odd <=9; odd +=2)
/** This for loop fills up rows 1,3,5,7,9
* in the array. These rows represent
* the rows that count up from right to left**/
{
for (i=9; i>=0; i--)
{
board [odd][i] = count;
count++;
}
count+=10;
} // odd

Now all we need to do is print out the array starting at row 9 and counting down to zero.

for (j=9; j>=0; j--)
{
for (i=0; i<=9; i++)
{
System.out.print(board[j][i] + " ");
}
}

Output:
100 99 98 97 96 95 94 93 92 91
81 82 83 84 85 86 87 88 89 90
80 79 78 77 76 75 74 73 72 71
61 62 63 64 65 66 67 68 69 70
60 59 58 57 56 55 54 53 52 51
41 42 43 44 45 46 47 48 49 50
40 39 38 37 36 35 34 33 32 31
21 22 23 24 25 26 27 28 29 30
20 19 18 17 16 15 14 13 12 11
1 2 3 4 5 6 7 8 9 10

Sunday, January 16, 2011

Learn PHP

I have not been doing much with hardware this semester. My senior classes are Computer Studies (programming). Some of the students expressed an interest in learning PHP - MySQL. This summer, at the CEMC summer institute for teachers, I was introduced to a package called XAMPP which essentially allows you to run Apache and MySQL databases from a USB Flash drive. I tried a few tutorials out and put together one of my own. The students were successful with my tutorial and were able to continue on and try out things on their own. One of the students, Shameel Khan, extended his learning by creating a Facebook-like application. Shameel documented his work in the form of 8 tutorials. This experience is a good extension to the Javascript lessons many students completed in grade 10.

Wednesday, November 10, 2010

Colour Tricorder


I built this project around the OOPIC Mark III but it should work with any microcontroller. The idea behind the famous Star Trek Tricorder was simple. Record the energy emissions from an object at 3 different frequencies. The ratio between the 3 frequencies will be unique to that object. The specific frequencies can tell us about the object's properties.
The Colour Tricorder uses 3 coloured LEDs, one at a time, to shine different frequencies of light onto an object. Going back to our high school physics we will recall that an object's colour is the result of the frequencies absorbed vs the frequencies reflected. RGB white light falling onto a red object will be reflected in the red part of the spectrum and absorbed in the green and blue. The Colour Tricorder measures the intensity of the light reflected from an object for each coloured LED light source. I used a photo resistor as a detector but a photo transistor will work as well. A green object will have a high reflectivity in green light but a low reflectivity in red and blue light. We can use these differences to teach our microprocessor to detect colours. The sensor shown was used to detect colour lines below the Mark III so the range is just 1 to 2 cm.
The schematic diagram is shown to the right. I will post some OOPic code later but the basic idea is to measure the analog value at i/o 1 three times, once while i/o 2 (green) is ON, once when i/o3 (red) is ON and once when i/o 4 (blue) is ON.
I tried out the sensor on several pieces of coloured paper and got mixed results. Blue and red detection was better than green, probably because the green LED used coloured plastic to produce green light. The red and blue LEDs were the clear type. I suspect that the bandwidth from blue and clear diodes is much tighter than from green and red coloured plastic LEDs.

Monday, November 8, 2010

ICT and Comm Tech. students can get FIT

Today our Computer Technology subject council heard about the ICTC FIT program from Dennis Hitchmough, Regional Project Manager (Ontario), Information and Communications Technology Council. Canadian High School students taking ICT or Media/Communications/Graphics courses may be eligible for a FIT certificate. You can find more information about this program on the ICTC website or at discoverIT.org. The FIT certification is already recognized by many companies in industry and retail and by many post secondary institutions. The certification indicates that the student has completed 33 criteria in 11 domains, many of which are awareness based and most, if not all, are a part of our regular curriculum.