Wednesday, March 31, 2010

Logochip - Challenge 2: Toggle Fix

We are trying to connect a switch into the input of the board which then supposedly makes the light (output) turn on and off each time we press the switch. The challenge was supposed to be to fix the switch bounce which was making this program unreliable. However, before we could get to the actual programing and the challenge we ran into many technical difficulties.

We figured out right off the bat that our motor wasn't working properly and so we had to get a new motor.

Next was to get everything actually plugged in and working properly. The motor and the switch were good. The problem here was getting the oscilloscope connected and functional and we ran into multiple problems in trying to do this. First off, our setting weren't right so we had to go through all of it fiddling with trying to get it to work. The only problem with this was that we were testing whether it was working properly or not by turning the circuit on and off but it wasn't connected properly to the circuit so it wasn't reading anything either way. Once had been struggling with this for a while we asked Professor Berg for help. At this time, Professor Berg basically set up the whole thing for us and while is do understand how to connect it better, I'm still not entirely sure I know how to work it and I still an not confident that I could do it on my own. But in better news, the oscilloscope was working now. And the switch-bounce looked like this.

One thing I did learn from this oscilloscope though, is that there are highs and lows. The high is the power source where the '+' is and the low is the ground where the '-' is. I realize that I probably should have know this before, but one step at a time...

So we figured out how long the switch bounce took we started fiddling with programs. First we started with the original wrong program that was shown in class and moved on from there. Actually our first idea was the one below (which actually is the right one) but it wasn't working. So we moved onto other complex (and wrong) programs that involved "if...thens" and other things. Eventually we had to, once again, call Professor Berg over because we were thoroughly our of ideas and frustrated. He walked us through it and brought us back to our first idea. Then it didn't work and Professor Berg we confused also. After which we figured out after all of this frustration that our switch wasn't working properly. So we finally got it to work and this is what the working program looks like.


No comments:

Post a Comment