| New Reply |
Resistor Calculator - C - Complete n00b |
Share Thread |
| Oct24-10, 01:14 PM | #1 |
|
|
Resistor Calculator - C - Complete n00b
Hi all,
I am studying to be an electrical engineer and I have a C programming course that all of a sudden took a massive jump..last week we were writing single For statements and things of that manner and now he assigned a program thats just got my completely stumped, I thought I was getting this stuff until now. My problem is that the first part of the flow chart he gave out wants to keep looping until an up arrow key is pressed or a down. My loop just seems to keep going tho. Oh and the problem assignment is that the user enters in a resistor value and chooses if they want the closest 10% series resistor greater than or less than the value they entered. Here is what ive got so far. |
| Oct24-10, 02:15 PM | #2 |
|
|
ohhhh....it's been a while here...but a couple possibilities come to mind.
First your "terminal" may not be set to return individual chars without a newline being typed. Look at the man page for getch() on whatever system you are using to see if that's the case, or you could just try typing <ENTER> after your arrow key. Second you may not be getting the values you think. I don't know what code to expect from an arrow key so I can't check....but would be a bit surprised to get two chars rather than just one with the top bit set. In either case, instrumenting your code is the way to proceed. printf() printf() printf() everywhere to trace operation and the values you get. Good luck with that C thing... |
| New Reply |
Similar discussions for: Resistor Calculator - C - Complete n00b
|
||||
| Thread | Forum | Replies | ||
| induced current through a resistor - with variable resistor and two coils | Introductory Physics Homework | 15 | ||
| help a n00b | Computing & Technology | 3 | ||
| Modulus n00b | Introductory Physics Homework | 4 | ||
| Physics n00b | Introductory Physics Homework | 17 | ||
| <------Mathematical n00b | Math & Science Software | 6 | ||