Go Down

Topic: Keypad Issues (Read 1 time) previous topic - next topic

Markham

Hello,

I've finally got it worked out! First of all I was writing code_read[a]=0 to put the whole string to zero instead of applying
Code: [Select]
memset (code_read,0,10); but that wasn't what was causing the program to not work properly . I had written a++ in a function 2 lines lower than it should have been and it was causing  the string to increment before it was intended. After using the serial monitor tool I was able to find out what was going on.

In any case thanks alot for your help in this matter!!

PaulS

Quote
First of all I was writing code_read[a]=0 to put the whole string to zero instead of applying ... but that wasn't what was causing the program to not work properly

Of course not. Functions that expect a NULL terminated string stop at the first NULL (the first stop sign). They do not need a bunch of stop signs to know to stop.

Quote
I had written a++ in a function 2 lines lower than it should have been and it was causing  the string to increment before it was intended.

That would do it.

Quote
After using the serial monitor tool I was able to find out what was going on.

Been suggesting that for a while. Glad it finally sunk in.

Feels good to find and fix a problem yourself, doesn't it?
The art of getting good answers lies in asking good questions.

Go Up