[Solved] Can I use Kill as a variable?

As the title says.

Can I use

int kill = 0;

as an interrupt variable or will it cause issues with other functions?

If you have questions about code, post ALL the code, using code tags.

Please explain what "interrupt variable" means to you.

Is it listed as a keyword in the language? No. Then you can use it. Unless it is being used by some library you are including and failed to mention.

Why, is something strange happening when you tried it?

Yes you can, but remember to declare it as “volatile” if it should be used in an interrupt handler.

Why do you think that it will cause problems?

If it's used in an interrupt and later needs to be used in e.g. loop(), you need to make it volatile.

And because an int is bigger than a word (on a Uno etc), turn off interrupts while reading it :slight_smile:

Thanks all, I just didn't know if it existed as a command like in linux.

@jremington - I did.
@Delta_G - Thanks, just double checking before I start to use it.
@Danois90 - Thanks, I was confused about that.
@sterretje - because computers use it.
@septillion - errr, opps, ok.