Go Down

Topic: Variables out of control! (Read 1 time) previous topic - next topic

sy kristina

Hi again all,

I am trying to combine two of my sketches that work well alone, and the combination is not that complicated. The strange thing is that it works from time to time, but then suddenly one or all three variables for the temperatures are lost, indicating anything from -1500 deg C to 3000 deg C! The variables are locked inside an if and a switch case, declared as 0 and updated every 10 mins from a serial event, but suddenly they are out of control. It doesn't sound like a memory thing to me.
Has anyone seen anything similar, in general terms?

Coding Badly

It doesn't sound like a memory thing to me.

Does to me.  Classic buffer overrun bug.

sy kristina

You were right. I moved an array into a function (was not needed outside) and it worked. It's easier to find the fault when you know what to look for...

Coding Badly

You were right

Don't be so surprised.  It's been known to happen occasionally.   ;)

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131