last day (15 days later) » 

15:26
-2
Q: keypad is printing squares instead of number

Amber FisherKeypad is printing squares instead of number. The code is below. #include <Key.h> #include <keypad.h> #define buzzpin 2 const byte ROWS = 4; //four rows const byte COLS = 4; //four columns //define the cymbols on the buttons of the keypads char hexaKeys[ROWS][COLS] = { { '1', '2', '3'...

I am use the same code that work 2 day ago.
this site is not a discussion forum.... all information must be in the question at top of this page ... use the edit button to update it ... right now, there is no code, no keypad, no Arduino
I did what you say and edit the question. I put the my code in here.
put debug code inside setup()
I did that but it is still have the same outcome.
15:26
Is the serial port really 9600? Mismatched Baud rates often caused unprintable characters. What is the character code of the square characters? Please edit and update your question with any additional information. Please do not put additional info in the comments, that is not what they are for.
Yes, but ignoring your code for one moment, what speed is your serial port actually set to?
No matter if I the low Mismatched Baud rates to 230400 Mismatched Baud rates. it still prints square
My serial port number is 13.
My Arduino is work fine. Work with other code just fine. Just on this code.
I have tried everything I could think of like reopen the program, change the Mismatched Baud rates, unplugging the board and resetting the board. That this port need help.
I did that but it is still have the same outcome ... Serial.print is debug code, not the #define ... just print anything in setup() ... "starting." would work
No it did not work.
it did not work is meaningless .. what happened?
it did not print the word.
15:26
then your problem probably has nothing to do with the keyboard ... remove the keyboard and delete all code inside loop() and try again
unsigned char key = keypad.getKey(); You have redefined key inside the while block. The scope is limited to that while block so the global key will never have its value changed. Also try to get a simple hello world sketch to print to the serial console.
Does this sketch build at all? Please edit your question to add a confirmation that you have no build errors. -- Your code says Serial.begin(600); that looks fishy. Are you really using 600 baud? -- Comment out all and try a simple "hello world" example.
that looks fishy. Are you really using 600 baud? Yes, I bet as well, a 9 got lost, and SerialMonitor expects a speed of 9600.
The 9 was intentionally removed by the OP in this edit. There are other variants of this code over on SO, where the OP has also asked questions.
I am not using 600 baud the least I time a edit it I for was change the number a forgot to put the 9.
15:26
Thanks for clarifying! Now there are only two points left open: 1. Does the sketch as presented build without error? 2. Does a simple "hello world" work?
can you clarify what you mean by sketch as presented build without error?
 
1 hour later…
16:44
"the sketch" = your program, "as presented" = in the state shown in your question, "build without error" = if you use the check button or the upload button, you receive no error in the output pane.

last day (15 days later) »