HELP: receiving text and output it to led matrix (see my codes)

Hello, I’m getting frustrated right now. I’ve been deubbging my code for many hours. Yesterday I’ve spent my almost 10 hours knowing what is wrong with my board.
So here is my story:
I have a sanguino board(644p) and I bought this LED MATRIX DRIVER board from an electronics shop here in my area and a LED MATRIX board with drivers. And fortunately it has a sample codes. I uploaded it, it is 100% working.
Next is I have a gsm module, yesterday I was searching for a sample sketch in receiving sms (sample from the IDE doesn’t work on my sanguino) for many hours and fortunately again I stumbled across one blog that uses a GSM shield library not similar to the arduino GSM library. I uploaded it and it works!
So I am very near to my goal: sending a text to the arduino/sanguino and output it to led matrix.
I have built several projects using my technique XD (combining two different sketches). Like using my android program to send a message and output it on led matrix. Using bluetooth to output any string from my laptop to LCD and many more…

Argggggggg. I feel that I want to burn all my electronics stuffs. I can’t find what the hell is wrong with my codes.
First, again, I uploaded the receiving sms to my board. Opened a Serial Monitor to check if I am really receiving a message. and the text from my cellphone to arduino/sanguino is displaying on serial monitor. Anyway, my whole codes is displayed below.

My theory is that the microcontroller outputs very fast and it couldn’t receive or read any text messages. When I put a larger delay, say 100 in the loop, below shift(); the text message works and outputs to led matrix, but the scrolluing is soooooo slow. I hope anyone would help me to solve my mystery.

#include "SIM900.h"
#include <SoftwareSerial.h>
#include "sms.h"

#include "CMAP.h"

int d;
unsigned char char_pointer;
char Display_Ram[38];
unsigned char mask;
char count;	
unsigned char shift_counter;

#define INTEN 6000

const char CLK = 5; 
const char DAT = 6; 
const char STR = 7; 
const char K0 = A0; 
const char K1 = A1; 
const char K2 = A2; 
const char K3 = A3; 
const char K4 = 8; 
const char K5 = 9; 
const char K6 = 10; 
const char K7 = 11; 

char number[]="3921234567";
char message[180];
char LED_DATA[] = "Send a text message to display...           ~";
char pos;
char *p;
void setup() {                
  pinMode(CLK, OUTPUT);     
  pinMode(DAT, OUTPUT);     
  pinMode(STR, OUTPUT);     
  pinMode(K0, OUTPUT);     
  pinMode(K1, OUTPUT);     
  pinMode(K2, OUTPUT);     
  pinMode(K3, OUTPUT);     
  pinMode(K4, OUTPUT);     
  pinMode(K5, OUTPUT);     
  pinMode(K6, OUTPUT);     
  pinMode(K7, OUTPUT);  


  d = 0;
void loop()

void shift(void) 
  Display_Ram[0] = Display_Ram[1];
  Display_Ram[1] = Display_Ram[2];
  Display_Ram[2] = Display_Ram[3];
  Display_Ram[3] = Display_Ram[4];
  Display_Ram[4] = Display_Ram[5];
  Display_Ram[5] = Display_Ram[6];
  Display_Ram[6] = Display_Ram[7];
  Display_Ram[7] = Display_Ram[8];
  Display_Ram[8] = Display_Ram[9];
  Display_Ram[9] = Display_Ram[10];
  Display_Ram[10] = Display_Ram[11];
  Display_Ram[11] = Display_Ram[12];
  Display_Ram[12] = Display_Ram[13];
  Display_Ram[13] = Display_Ram[14];
  Display_Ram[14] = Display_Ram[15];
  Display_Ram[15] = Display_Ram[16];
  Display_Ram[16] = Display_Ram[17];
  Display_Ram[17] = Display_Ram[18];
  Display_Ram[18] = Display_Ram[19];
  Display_Ram[19] = Display_Ram[20];
  Display_Ram[20] = Display_Ram[21];
  Display_Ram[21] = Display_Ram[22];
  Display_Ram[22] = Display_Ram[23];
  Display_Ram[23] = Display_Ram[24];
  Display_Ram[24] = Display_Ram[25];
  Display_Ram[25] = Display_Ram[26];
  Display_Ram[26] = Display_Ram[27];
  Display_Ram[27] = Display_Ram[28];
  Display_Ram[28] = Display_Ram[29];
  Display_Ram[29] = Display_Ram[30];
  Display_Ram[30] = Display_Ram[31];
  Display_Ram[31] = Display_Ram[32];
  Display_Ram[32] = Display_Ram[33];
  Display_Ram[33] = Display_Ram[34];
  Display_Ram[34] = Display_Ram[35];
  Display_Ram[35] = Display_Ram[36];
  Display_Ram[36] = Display_Ram[37];
  if(shift_counter == 6){
    shift_counter = 0;

void Display(void)
  mask = 0x01;

  mask = 0x02;

  mask = 0x04;

  mask = 0x08;

  mask = 0x10;

  mask = 0x20;

  mask = 0x40;

  mask = 0x80;

void load(void){
  char counter1;
  if(LED_DATA[char_pointer+1] == '~')
    char_pointer = 0;
  for(counter1 = 0; counter1 < 5; counter1++){
    Display_Ram[32 + counter1] = character_data[(LED_DATA[char_pointer] - 0x20)][counter1];
  Display_Ram[37] = 00;	

void Clear_Display_Ram(void){
  unsigned char rcount;
  for(rcount = 0; rcount < 37; rcount++)
    Display_Ram[rcount] = 0xff;

void scan(void){
  for (count=32;count>(-1);count--){
    if ((Display_Ram[count] & mask) == mask)

void clock(void){
  digitalWrite(CLK,HIGH);			// clock hi
  digitalWrite(CLK,LOW);		        // clock low

void strobe(void){
  digitalWrite(STR,HIGH);			// strobe hi
  digitalWrite(STR,LOW);			// strobe low