diff --git a/enigma.ino b/enigma.ino index 8553750..c55272d 100644 --- a/enigma.ino +++ b/enigma.ino @@ -17,8 +17,8 @@ Adafruit_Keypad kbd = Adafruit_Keypad( makeKeymap(keys), rowPins, colPins, KBD_R #include LiquidCrystal lcd(19, 18, 17, 16, 15, 14); -const int LCD_COLS = 16; -const int LCD_ROWS = 2; +const int LCD_COLS = 20; +const int LCD_ROWS = 4; bool debug_mode = false; @@ -59,9 +59,10 @@ byte rotor_type [] = { 1, 2, 3 }; // reflector "UmkehrwalzeUmkehrwalze" byte reflector_type = 12; -char plugboard [10][2] = { - {'-','-'}, {'-','-'}, {'-','-'}, {'-','-'}, {'-','-'}, - {'-','-'}, {'-','-'}, {'-','-'}, {'-','-'}, {'-','-'} +const int PLUGBOARD_SIZE = 10; +char plugboard [PLUGBOARD_SIZE][2] = { + {'A','B'}, {'.','.'}, {'.','.'}, {'.','.'}, {'R','Z'}, + {'C','D'}, {'.','.'}, {'.','.'}, {'.','.'}, {'G','H'} }; // track rotor positions @@ -187,8 +188,14 @@ char encode (char c) { } } + char plug_c = AZ[pin]; + // plugboard - // TODO + for (int i=0; i 2) { + for (int i=0; i