writerveggieastroprof
My Journal

Previous Entry :: Next Entry

Mood:
Just Glad That's Done

Read/Post Comments (0)
Share on Facebook



Last Minute Class Activity Improvisation

Student "edition" found at {csi dot journalspace dot com}.

Maybe I shouldn't have started this blog now, not with everything that's been going on.

This morning for my intermediate robotics class, my guest lecturers both arrived too late for them to discuss their thesis with the students.

I had given them an exercise at the start that was supposed to only consume a third of the class time until the thesis students arrived, but not surprisingly it ended up taking the entire period.

Since during their laboratory sessions earlier this week we already used the programmable integrated circuit bought for the thesis students.

Instead of merely entering one decimal value in a program or clicking buttons to light the LEDs, they now had to come up with a specific sequence that the lights would turn on and off.

The simplest type of this is just one LED that moves from left to right and back (also known as the KITT scanner from the show "Knight Rider".

Next I introduced input, which is in the form of three binary switches.

Depending of the values of these switches, zero to seven LEDs will light.

Now, the trick here is that I did not specify the order or sequence of the lights.

So the simplest type of program was the one did not take the order into consideration.

The program checked the first switch, which controlled only one light.

The second switch controlled two lights, and the third switch controlled four lights.

So here there were only three short "if" or conditional statements in the program.

The rest used up to eight conditional statements with up to three conditions per statement, all of which controlled all the lights.

Next I would ask them to compute for the number first, then use a loop statement to light up that number of diodes on the board.

Session 1847 are used to the brute force repeated statement writing method of programming. Class dismissed.


Read/Post Comments (0)

Previous Entry :: Next Entry

Back to Top

Powered by JournalScape © 2001-2010 JournalScape.com. All rights reserved.
All content rights reserved by the author.
custsupport@journalscape.com