Wednesday, March 31, 2010

Logochip - Challenge 3: Counting Edges

This challenge can basically be broken down into two different sections. The counting section and the getting the light to blink section. And neither of us having had a cs or programming background, had no idea how to go about doing this. Actually, we didn't even know where to start. We set up the switch and the light but then we sat staring at combinations of two or three pieces that had no chance of working.

We knew that we still had to incorporate the previous challenge because we still had to face the problem of bounce. Beyond that we figured that it had something to do with the recording program so we went back into the tutorial to try and find that section where we created some sort of graph. We tinkled with a lot of stuff and eventually we got a lot of help from Lyn.

When Lyn came over he basically walked us through the logic of how to create the program. The logic behind making programs is very different from other things. It requires a different way of thinking and I think it'll take a little while to figure out the thought processes.

He explained to us that we need to set the program. So start the count and zero. And then we can start the sequence. The sequence was very similar to the one for the toggle challenge. However, what we had to figure out for this one was how to use the 'n' and the print blocks. These were basically what would count the number of times the button was pressed. One of the keys were having the 'n+1'.

Now we had to add the flash which was, surprisingly, simple. We just had to use the 'if' block and make the condition that n=5 and then have the light flash and reset n=0.


Programs always seem so much simpler when they are all done and working. However, they are far from simple to make and when a program doesn't work I find that it's really hard to figure out what is wrong or if the whole entire procedure is wrong.

No comments:

Post a Comment