Show Posts
Pages: 1 ... 54 55 [56] 57 58 ... 98
826  Using Arduino / Programming Questions / Re: write big number in eeprom on: September 25, 2013, 03:51:35 pm
Why BCD? An array of 10 bytes will do, and be easy to stuff into the EEPROM.
827  Using Arduino / Programming Questions / Re: Noob with errors on: September 24, 2013, 02:56:12 pm
float there is not a function, it is a cast. The proper syntax is psi = (float)sensor1(...);
828  Using Arduino / Programming Questions / Re: Strange Apearence of 5V on: September 24, 2013, 11:47:19 am
The only problem I see is mixing of integers and floats, but that shuold not cause the problem.

Are you sure this is all the code? Did you copy and paste or type it in?
829  Using Arduino / General Electronics / Re: Paralleling ATX power supplies on: September 23, 2013, 11:09:34 am
Both power supplies would work against each other trying to force the common point to the voltage each thinks it should be, causing a lot of current to flow in the process.

You can put a 1 ohm 17 W resistor in series with each one to isolate them a bit, but you will waste a lot of power.
830  Using Arduino / Programming Questions / Re: Display floating point temperature on 7-segment display on: September 20, 2013, 04:16:50 pm
Try dtostrf()
http://forum.arduino.cc/index.php?topic=85523.0

I used this for this exact thing, and simply did a search for the '.' and printed the digits on either side as needed.
831  Using Arduino / Programming Questions / Re: Looping in a function on: September 20, 2013, 11:26:20 am
While gotos should be used sparingly, and the main problem is when they jump huge disstances which is not your case at all, this really looks like a do-while loop.
832  Using Arduino / Programming Questions / Re: Compiler optimization of while() conditions on: September 19, 2013, 02:16:53 pm
I suggest you put a comment that you really do want to do an assignment in a logical condition. 99.99% of the time this construct is a typo where == was intended.
833  Using Arduino / Programming Questions / Re: How to return and error in constructor? on: September 18, 2013, 01:37:19 pm
"Or, don't...."

Oops, my C is showing.  errno, anyone?

You could create an error condition variable in the class and use a getError() method to read it.

Is that better?

Though the start method idea is better.
834  Using Arduino / Programming Questions / Re: How to return and error in constructor? on: September 18, 2013, 12:25:09 pm
Set a global variable to an error condition.

BTW, it would do no good to tell main() that there is an error, since you never get there with an arduino.
835  Using Arduino / Programming Questions / Re: Significant digits mysteriously appearing when converting from int to float on: September 18, 2013, 12:22:01 pm
And please stop misusing the term "significant digits" the noise at the end is past signifigance.
836  Using Arduino / Programming Questions / Re: Significant digits mysteriously appearing when converting from int to float on: September 18, 2013, 11:39:32 am
Check out the questions about floating point in the C Programming FAQ, especially:
http://c-faq.com/fp/fpequal.html
837  Using Arduino / General Electronics / Re: 7812 and TIP122 on: September 17, 2013, 05:28:55 pm
The 7812 is a 12 V regulator. The TIP122 is an NPN bipolar power transistor. You would need to add other components to make it a regulator.

Get thee to a datasheet!
838  Using Arduino / General Electronics / Re: Completely confused about MOSFETs on: September 17, 2013, 01:57:49 pm
The drain has to be more positive than the source. You are conducting current through the Drain-Body diode.
839  Using Arduino / Programming Questions / Re: Do While with Char[] test on: September 12, 2013, 05:55:45 pm
No, what I am saying is that you read a character and put it in profName[i].
You print profName[i]. Great you got it!
*you increment i* with i++
Then you test i on the incremented i, so that profName[i] is pointing to garbage.

Moderator edit: Italics removed, indices restored.
840  Using Arduino / Programming Questions / Re: Do While with Char[] test on: September 12, 2013, 05:49:41 pm
It looks to me that your i++ is incrementing past the test for '.'
Pages: 1 ... 54 55 [56] 57 58 ... 98