Hello Everyone, I am having trouble with a long data type in my code. I initialize the variable as a long, but the program keeps interpreting it as an integer. I know this because if there is a number > ~32000, it rolls over to -32536
I have included only the lines of code that are relevant...
long SpecimenHeatTime; // seconds remaining in the maintain heat mode (300 = 5 minutes)
long TR; // time remaining
long BeenHeating
void setup() {
SpecimenHeatTime = 33*1000; // seconds remaining in the maintain heat mode (300 = 5 minutes)
TR = SpecimenHeatTime; // time remaining
BeenHeating = 0;
}
void loop() {
Serial.print("toplevel "); Serial.println(TR); Serial.println(SpecimenHeatTime); Serial.println(BeenHeating); Serial.println(WakeUpTime); //debug 2/3/2012
}
;
Per the comments, they don't get changed or updated every time i try something new in the code and re-upload
I understand that comments do not get updated. The comments, though, should reflect what the code is doing. Stating the obvious doesn't add anything meaningful. Those are the comments that are least likely to get updated when the code changes.
I use two styles with comments.
// Comments like this are used to describe what the program is doing
// They provide an overview of the program structure or a specific block
if(someConditional) // Comments here show pitfalls or specific issues
I think comments are useful, but when they don't add anything, the delete key is the most useful key to use.