bonjour a tous
pas tres a l'aise avec les tableaux, je pose mon probleme
j'ai un keypad et le bout de code qui marche
mais je souhaite afficher plus
lorsque je tape sur mes touches ex: 1 ou 2 etc j'ai bien la variable a 1 chiffre
je souhaite aller a ex: 23 ou 59 donc une variable a 2 chiffres
avec validation par * ou # pour saisir la variable a 2 chiffres suivante
il s'agit de heure minute seconde
j'utilise un keypad avec pcf8574 sur i2c
une aide me serait agreable
merci
#include <Keypad_I2C.h>
#include <Keypad.h>
#include <Wire.h>
#define I2CADDR 0x25const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
// Digitran keypad, bit numbers of PCF8574 i/o port
byte rowPins[ROWS] = {0, 1, 2, 3}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {4, 5, 6}; //connect to the column pinouts of the keypadKeypad_I2C kpd( makeKeymap(keys), rowPins, colPins, ROWS, COLS, I2CADDR, PCF8574 );
void setup(){
Wire.begin( );
kpd.begin( makeKeymap(keys) );
Serial.begin(9600);
Serial.println( "start" );
}
void loop(){char key = kpd.getKey();
if (key){
Serial.println(key);
}
}