Thread: Arduino issues
View Single Post
Old 03-04-13, 10:05 AM   #12
AC_Hacker
Supreme EcoRenovator
 
AC_Hacker's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 723 Times in 534 Posts
Default

Quote:
Originally Posted by Piwoslaw View Post
The line:
Code:
steinhart -= 273.15;
is the same as:
Code:
steinhart = steinhart - 273.15;
so this in itself is not a problem.


I think this is an illegal line... with the minus in front of the equal sign:

Code:
steinhart -= 273.15;
I you want steinhart to take the value of 273.15, you could say:

Code:
steinhart = 273.15;
I you want steinhart to take the value of -273.15, you could say:

Code:
steinhart = -273.15;
... or even:

Code:
steinhart = 273.15 * -1;
If you want to increase whatever value steinhart already has by 273.25, you could say:

Code:
steinhart = steinhart + 273.15;
If you want to decrease whatever value steinhart already has by 273.25, you could say:

Code:
steinhart = steinhart - 273.15;

& & &


The part of the program that is at the top, in other words above...

Code:
void setup()   {
... is where all variable name must be declared, or else the program will not know what the strange undefined words mean.

steinhart is a variable name and it needs to be defined as such in this section.

The middle part of the program, that is below...

Code:
void setup()   {
but above...

Code:
void loop()
Is where initial values are set... in other words, you can't assume that the first time you use steinhart that it will have a value of zero, you have to make it so.


& & & & & &


You can't expect anyone to give useful advice on a program or on what it's debugger message means unless you have quoted ALL of the program and ALL of the debugger message.

Else, you're wasting everyones time, including your own.

-AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker...
AC_Hacker is offline   Reply With Quote
The Following User Says Thank You to AC_Hacker For This Useful Post:
Mikesolar (03-05-13)