Hi Class,
After trying a lot I can't do the basics. I want to type 123456 on the keyboard and see the digits 'move' to the left showing 123456 as I type. That simple.
//https://jasonacox.github.io/TM1637TinyDisplay/
#include <TM1637TinyDisplay6.h>
#include <Keypad.h>
// TM1637 - 6 pinos
const int CLK = 3;
const int DIO = 2;
TM1637TinyDisplay6 display(CLK, DIO);
#define ROW_NUM 4 //4 linhas
#define COLUMN_NUM 4 //4 colunas
char keys[ROW_NUM][COLUMN_NUM] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
byte pin_rows[ROW_NUM] = {8, 9, 10, 11};
byte pin_column[COLUMN_NUM] = {12, 13, 14, 15};
Keypad keypad = Keypad( makeKeymap(keys), pin_rows, pin_column, ROW_NUM, COLUMN_NUM );
char key = keypad.getKey();
void setup() {
Serial.begin(115200);
delay(10);
Serial.println();
display.begin();
}
//------------------------------------------------------------------------------------------
void loop() {
char key = keypad.getKey();
if (key) {
uint8_t x = key;
display.showNumberDec(x);
Serial.println(x);
}
if (key) {
Serial.println(key);
}
}
I've already tried String(key) but the display library doesn't seem to accept it.
Type 1, show 1, type 2, show 12, type 3, show 123 and so on, until 123456.
Can anyone 'adjust' the code to make this happen ?
Grateful