NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Support Forum » Trying to modify the Real Time Clock project
December 31, 2010 by Ralphxyz |
I am trying to capture a 1 second block of time (count).
Time stands still. I get 1.00 sec and Count: 0 frozen nothing more. It seems logical (doesn't it) that the the_time counts up to 100 then count is incremented by 1. Then do it again. Why does it freeze (or more concisely why doesn't it work)? Ralph |
---|---|
December 31, 2010 by Rick_S |
= is the assignment operator == is for checking a variable against another. So when you said on line 7 if (the_time = 100) you assigned the_time the value of 100. To check against 100 it should read if (the_time == 100) The same is true for the if statement on line 29. Hope that helps out, I still catch myself doing this on occasion, Rick |
Please log in to post a reply.
Did you know that the Timer/Counter modules on the microcontroller can be configured to output a PWM (Pulse Width Modulation) signal? Learn more...
|