I use 4digit 7 segment display. I store 4 values, one for each digit and keep refreshing the display. I get a weird bug.
Some bits are turned on even when they are off in the stored values. See line numbers 171 to 178 of the application.cpp. I get the error, if I replace the block(lines 171 to 178) with interval = intervalAfterFirstUpdate;Crazy…
How can you reproduce this error?
Do the above mentioned code change.
Add the following lines in the beginning of the function setSegmentValues
minus=False;
temp=0;
Run the code.
Connect a led between the pins (D5 and D0) or (A3 and D0) and it shouldn’t be on but it is.
I see, but symptoms like you mentioned in your code
often point towards memory corruptions due to bad indexing, buffer overflows and such things.
If you try moving this block further down step-by-step and watch when the issue starts appearing, you may find the code section to further investigate.
BTW, in @peekay123's code these arrays are global while they are automatic (local, stack based) in your case.
And in order to analyse the code of void processWeather(const char *event, const char *data) a comment stating a representative sample for the data field would help.
I understand your comments and suggestions. I will try that. Thanks again for your suggestions.
But, here is my concern. If you look at the comment at line number 93 , adding || (temp < 100 && !minus) to that ternary condition is reintroducing the error even with the code block. Also moving the unrelated code block to debug is kind of blind. Am I not doing anything right?
Also a basic question. would my variable w_temp work for variable work for data value 800~-100.81? I think no. I should increase the size to 8.
I have added the sample data in the new commit.