Another week is done! We had some hiccups in class this week, but I think everyone did well. I was the low-performer this week.
This week we covered loops. We learned the parts of a loop and how they are implemented as “while” loops and “for” loops. I think everyone understood the general concept of a loop, but many people had trouble formulating exactly how and when to use loops, and especially how to get the loop to solve their need.
Think about it like this – any time you need to do something repeatedly in a row, you probably want a loop to do it. You need to figure out a “control” variable to tell you how many times to loop (so you know when you are done), and you need to figure out what you actually want to do during the loop – what is the basic function you are repeating.
Remember, the computer is stooooooopid. It will only do exactly what you tell it to do. Before trying to run your programs, you should try to trace how the program itself will run. Keep a sheet of paper, and write down exactly what gets placed in each variable at each step. Don’t invent steps that are not written! Think back to the game where we just fetched and processed instructions. The computer only does exactly what you tell it to, so if you are following your own code keep that in mind!
Email me if you have any problems or questions.
I will get your section 2 assignments graded this week and handed back to you next class. If you did not get your section 2 in to me yet, please email me soon!
Electronics this week was, well, kind of a fiasco. That is mostly my fault. First, I lost the attendance/grading sheet. Don’t worry, I found it this evening. All is well. We also spent more time reviewing than I anticipated. Then, all of my plans were on my computer, which lost power. So, we ended up trying to squeeze one of our larger projects in a very short timespan without any plans. Unsurprisingly, that didn’t go well.
In any case, I have a solution. I recorded a video of what I was planning to do/show in class. You can follow it at home and try it out and see how it works for you. You can view the video by clicking on this link. I am uploading it to YouTube as I type, so it might not be available until tomorrow morning (October 6). Anyway, if you were confused in class, PLEASE watch the video, as it should clear most things up. Email me with any issues you are still confused about.
Remember, the “output” of the LM393 has two states – positive and zero. The zero state basically connects the output directly to ground. The “positive” state is kind of wierd, as it merely disconnects itself from the circuit. This allows you to provide your own power to the output. Therefore, we use a pull-up resistor to provide power to the circuit. You should have a 2,000-ish ohm resistor in your box. This would be optimal for that circuit.
Note that this circuit is also in your chapter. The one difference is that the circuit in the chapter uses a 15,000-ohm resistor, but I gave you a 10,000-ohm resistor. That’s because I don’t have any 15,000’s at the moment, but a 10,000 should do fine. For the first (fixed) voltage divider you can use any two resistors as long as they are of equal value.
One more note – the LM393 can be easily broken. If the output gets connected to the positive rail without a resistor, it croaks pretty quick. If you think you did everything right and it still doesn’t work, bring it in next week and we can check your LM393 to see if it is working right. Bring in your working project for next week. If you can’t get it to work, email me.
There is a quiz scheduled for next week, but I think I am going to back it up a week and make sure everyone has the time to get themselves more familiar with the common circuit patterns. We are learning one more next week.
Apparently, I am behind on giving you all a quiz. We will have a comprehensive quiz next class session. You all are doing well, so I have no doubt you will do well on the quiz.