??? 01/03/12 09:55 Read: times |
#185282 - Care for details Responding to: ???'s previous message |
I would say your programming error is similar to your posting error - lack of care for details.
1) You did post source code. You did not make use of that fancy button "Insert Program Code". So your code isn't indented. 2) You did not specify in your post what works, and what doesn't work. You expect us to just read source code to figure out what could be wrong. You, on the other hand, would not only have access to the source code but also the hardware. We don't even know if your hardware is in working order or not - you just may have correct code but broken hardware... 3) You haven't told us anything about what debugging you have done. You might not realize it. But debugging is a major part of programming. You are not a programmer if you don't also debug. 4) Why do you involve floating point numbers? void int_to_digits(unsigned long number) obviously takes an integer as input. How can there be any floating point values hiding in that integer, that just requires floor() and modf() to extract? 5) What use is it to do the same thing multiple times in a row? itd_a = itd_b / 10.0; dig[2] = floor((modf(itd_a,&itd_b)* 10)+0.5); itd_a = itd_b / 10.0; dig[1] = floor((modf(itd_a,&itd_b)* 10)+0.5); itd_a = itd_b / 10.0; Wouldn't you be quite bored of having itd_a always being itd_b / 10? 6) Missing lots of comments about what you think you are doing - and more specifically "why". 7) Who can love variables named a, b, c, d, e, f - and f being different data type than a..e? ... |
Topic | Author | Date |
frequency counter | 01/01/70 00:00 | |
Care for details | 01/01/70 00:00 | |
frequency counter | 01/01/70 00:00 | |
Still not correctly posted code. Still arbitrary floats... | 01/01/70 00:00 | |
Check some small things | 01/01/70 00:00 | |
typical | 01/01/70 00:00 | |
what a mess | 01/01/70 00:00 |