I'm using uLCD-43PT to create a keypad for the first time, so i have several concerns:
1-I don't know how to connect the code with the keypad, is it only by using Arduino genie library?
2- what are the main functions that should be included in the code (if anyone can share a code example that would be very helpful)
Moreover, this is what i have reached, but I'm not sure of its accuracy:
#include <genieArduino.h>
#include <Wire.h>
#include <Keypad.h>
#define Form1 0*01;
int Winbutton1;
const 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','*'}
};
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup(){
Serial.begin(9600);
genieSetup (9600);
}
void loop(){
genieWriteObj (GENIE_OBJ_FORM, 0, 0);
char key = keypad.getKey();
if (key != NO_KEY){
Serial.println(key);
}
}
void lcdUpdate(){
genieWriteObj (GENIE_OBJ_INPUTS, 0, Keyboard1);
genieWriteObj (GENIE_OBJ_BUTTONS, 0, Winbutton1);
}
}
your help is appreciated,
thanks
1-I don't know how to connect the code with the keypad, is it only by using Arduino genie library?
2- what are the main functions that should be included in the code (if anyone can share a code example that would be very helpful)
Moreover, this is what i have reached, but I'm not sure of its accuracy:
#include <genieArduino.h>
#include <Wire.h>
#include <Keypad.h>
#define Form1 0*01;
int Winbutton1;
const 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','*'}
};
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup(){
Serial.begin(9600);
genieSetup (9600);
}
void loop(){
genieWriteObj (GENIE_OBJ_FORM, 0, 0);
char key = keypad.getKey();
if (key != NO_KEY){
Serial.println(key);
}
}
void lcdUpdate(){
genieWriteObj (GENIE_OBJ_INPUTS, 0, Keyboard1);
genieWriteObj (GENIE_OBJ_BUTTONS, 0, Winbutton1);
}
}
your help is appreciated,
thanks
Comment