I draw my project in Autodesk Circuits (but there I could only use arduino Uno), I copy code that you show me. But I do not know what exactly I must to do in this step --> // add your port/segment driving lines here //
Also when I want to start simulation program give me error 25:1: error: expected unqualified-id before numeric constant
What is wrong?
Here is link https://circuits.io/circuits/1807671-7-led-segment-display
Or just a code:
#include <Keypad.h>
#define LED 13
const byte ROWS = 4;
const byte COLS = 4;
char keyInsert[6];
//int i = 0;
//int j = 0;
//int s = 0;
//int x = 0;
//char code[7]= "11ABCD";
char Keys[ROWS][COLS]=
{
{'1','2','3','A'} ,
{'4','5','6','B'},
{'7','8','9','C'},
{'F','0','E','D'} // I changed # and * to F and E here
};
byte colPins[4] = {10,11,12,13};
byte rowPins[4] = {A5,A4,A3,A4};
Keypad keypad = Keypad( makeKeymap(Keys), rowPins, colPins, ROWS, COLS);
// Add your font array here
0b00111111, // 0 DP-g-f-e-d-c-b-a, 1 = segment on, 0 = segment off
0b00000110, // 1
0b01011011, // 2
0b01001111, // 3
etc
0b01110001, // F
void setup(){
Serial.begin(9600);
pinMode(LED,OUTPUT);
// Add your pinMode code here
for (byte x = 2; x<9; x=x+1){ // here I changed formula x=22; x<30; x=x+1
pinMode (x, OUTPUT);
}
void loop(){
char key = keypad.getKey();
// add your port/segment driving lines here
PORTA = fontArray[key]; // with PORTA is pins D29 to D22, connect to DP-g-f-e-d-c-b-a