Hey guys, I am quite new to this arduino stuff and I have never really done any programming in C. I am trying to get input from a keyboard, save it to an array of chars and then output that array to the 8*8 matrix LED. I have combined code of previous people of the Keyboard and displaying a message on the MAtrix LED - which was found on the Arduino website.
I have tried many ways to do this including trying to save serial.read to an array but still not luck with outputing it, I wonder if anyone can look at my code and see where I am going wrong. This would be MUCH APPRECIATED
#include "ps2.h"
#define PS2_KC_BKSP 0x08
#define PS2_KC_UP 0x81
#define PS2_KC_DOWN 0x82
#define PS2_KC_LEFT 0x83
#define PS2_KC_RIGHT 0x84
#define PS2_KC_PGDN 0x85
#define PS2_KC_PGUP 0x86
#define PS2_KC_END 0x87
#define PS2_KC_HOME 0x88
#define PS2_KC_INS 0x89
#define PS2_KC_DEL 0x8A
#define PS2_KC_ESC 0x8B
#define PS2_KC_CLON 0x8C // caps_lock on
#define PS2_KC_CLOFF 0x8D // caps_lock off
/*
* Pin 2 is the ps2 data pin, pin 3 is the clock pin
*/
PS2 kbd(3, 2);
bool ps2Keyboard_release = false;
bool ps2Keyboard_extend = false;
bool cmd_ack_byte_ok = false;
bool ps2Keyboard_shift = false;
bool ps2Keyboard_alt = false;
bool ps2Keyboard_caps_lock = false;
bool ps2Keyboard_ctrl = false;
byte ps2Keyboard_CharBuffer = 0;
byte code;
int count = 0;
int speed = 20; //number of times to repeat each frame
int pauseDelay = 500; //microseconds to leave each row on before moving to the next
char requestString[] = ""; //The string to display
int index = 0; //this is the current charachter in the string being displayed
int offset = 0; //this is how many columns it is offset by
//Pin Definitions
int rowA[] ={11,14,16,18,13,5,7,9}; //5,6,7,8,9,10,11,12 of matrix
//(rows are common anode (drive HIGH))
int colA[] = {8,6,4,19,17,15,12,10}; //24,23,22,21,4,3,2,1 of matrix
//(columns are common cathode (drive LOW))
//Constants defining each charachters position in an array of integer arrays
//Letters
const int A = 0; const int B = 1; const int C = 2; const int D = 3; const int E = 4;
const int F = 5; const int G = 6; const int H = 7; const int I = 8; const int J = 9;
const int K = 10; const int L =11; const int M = 12; const int N = 13; const int O = 14;
const int P = 15; const int Q =16; const int R = 17; const int S = 18; const int T = 19;
const int U = 20; const int V =21; const int W = 22; const int X = 23; const int Y = 24;
const int Z = 25;
//Punctuation
const int COL =26; const int DASH = 27; const int BRA2 = 28; const int _ = 29; const int LINE = 34;
const int DOT =36;
//Extra Charchters
const int FULL =30; const int CHECK = 31; const int A3 = 32; const int TEMP = 33;
const int SMILE =35; const int COLDOT = 36;
//The array used to hold a bitmap of the display
//(if you wish to do something other than scrolling marque change the data in this
//variable then display)
byte data[] = {0,0,0,0,0,0,0,0};
//The alphabet
//Each Charachter is an 8 x 7 bitmap where 1 is on and 0 if off
const int _A[] = {B0001000,
B0010100,
B0100010,
B1000001,
B1111111,
B1000001,
B1000001,
B0000000};
const int _B[] = {B1111110,
B0100001,
B0100001,
B0111110,
B0100001,
B0100001,
B1111110,
B0000000};
const int _C[] = {B0011111,
B0100000,
B1000000,
B1000000,
B1000000,
B0100000,
B0011111,
B0000000};
const int _D[] = {B1111100,
B0100010,
B0100001,
B0100001,
B0100001,
B0100010,
B1111100,
B0000000};
const int _E[] = {B1111111,
B1000000,
B1000000,
B1111100,
B1000000,
B1000000,
B1111111,
B0000000};
const int _F[] = {B1111111,
B1000000,
B1000000,
B1111100,
B1000000,
B1000000,
B1000000,
B0000000};
const int _G[] = {B0011111,
B0100000,
B1000000,
B1001111,
B1000001,
B0100001,
B0011111,
B0000000};
const int _H[] = {B1000001,
B1000001,
B1000001,
B1111111,
B1000001,
B1000001,
B1000001,
B0000000};
const int _I[] = {B1111111,
B0001000,
B0001000,
B0001000,
B0001000,
B0001000,
B1111111,
B0000000};
const int _J[] = {B0001111,
B0000001,
B0000001,
B0000001,
B0000001,
B1000001,
B0111110,
B0000000};
const int _K[] = {B1000011,
B1000100,
B1001000,
B1110000,
B1001000,
B1000100,
B1000011,
B0000000};
const int _L[] = {B1000000,
B1000000,
B1000000,
B1000000,
B1000000,
B1000000,
B1111111,
B0000000};
const int _M[] = {B1110110,
B1001001,
B1001001,
B1001001,
B1001001,
B1001001,
B1001001,
B0000000};
const int _N[] = {B1000001,
B1100001,
B1010001,
B1001001,
B1000101,
B1000011,
B1000001,
B0000000};
const int _O[] = {B0011100,
B0100010,
B1000001,
B1001001,
B1000001,
B0100010,
B0011100,
B0000000};
const int _P[] = {B1111110,
B0100001,
B0100001,
B0111110,
B0100000,
B0100000,
B0100000,
B0000000};
const int _Q[] = {B0011100,
B0100010,
B1000001,
B1000001,
B1000101,
B0100010,
B0011101,
B0000000};
const int _R[] = {B1111110,
B0100001,
B0100001,
B0101110,
B0100100,
B0100010,
B0100001,
B0000000};
const int _S[] = {B0111111,
B1000000,
B1000000,
B0111110,
B0000001,
B0000001,
B1111110,
B0000000};
const int _T[] = {B1111111,
B0001000,
B0001000,
B0001000,
B0001000,
B0001000,
B0001000,
B0000000};
const int _U[] = {B1000001,
B1000001,
B1000001,
B1000001,
B1000001,
B1000001,
B0111110,
B0000000};
const int _V[] = {B1000001,
B1000001,
B1000001,
B1000001,
B0100010,
B0010100,
B0001000,
B0000000};
const int _W[] = {B1000001,
B1001001,
B1001001,
B1001001,
B1001001,
B1001001,
B0110110,
B0000000};
const int _X[] = {B1000001,
B0100010,
B0010100,
B0001000,
B0010100,
B0100010,
B1000001,