interrupts question...

And Coding Badly will always be Dallas in mine. ;)

There was an old thread where he was called that.

And another one where [name withheld to reduce embarrassment] had trouble determining where in the world I live. My moniker must invoke chaos and confusion. ]:slight_smile:

[quote author=Coding Badly link=topic=94974.msg716946#msg716946 date=1331085368]

And another one where [name withheld to reduce embarrassment] had trouble determining where in the world I live. My moniker must invoke chaos and confusion. ]:)

[/quote]

It sure does Mr.Tesla. ;)

I don't know where you are from jogz but nobody here will be offended if you don't call them sir, trust me :) Just use their forum name or their real name if they provide it.


Rob

And don't be afraid to call me for dinner also.

[quote author=Coding Badly link=topic=94974.msg716946#msg716946 date=1331085368] And another one where [name withheld to reduce embarrassment] had trouble determining where in the world I live. My moniker must invoke chaos and confusion. ]:) [/quote]

I suppose you should be thankful you aren't called Global or Sir Moderator these days.

I think I'll go with Mr. Nick its more respectful to hear..:) Thank you very much guys.... I have a problem..the remote wont work...:((

Did you follow my suggestion of setting the flag in the ISR and testing it in loop? And are you sure that number you are testing for is the correct one?

I figured whats wrong Mr Nick, the irrecv.enableIRIn(); should be at the void setup()....Thank you very very very much Mr Nick...I write again if something is wrong... :)

You are welcome Mr. jogz44.

Mr. Nick i have a problem… :frowning: when I add some decode value the program stuck at the infinite loop… here is an example…

void loop() 
  {	
  display_word(1,your_text,11,40); 
  if (button_pressed)
    {
    irrecv.enableIRIn(); 
    while(true)  // loop until right button pressed ??
      {
      if (irrecv.decode(&results)) 
        {
        Serial.println(results.value, DEC);
        irrecv.resume(); 
        }
      if (results.value==16720095) 
        break;
      irrecv.resume(); 
     if(results.value==1255403)
     {
     for(i=0;i<9;i++)
     your_text[0][i]=dummy_text[0][i];
    irrecv.resume();
   }
     }
    button_pressed = false;
    }
  }

Moderator edit: There’s a really good reason we use CODE TAGS, which you just demonstrated.

when I add some decode value the program stuck at the infinite loop.

So, get rid of the infinite loop. It is pointless to have an infinite loop inside an infinite loop.

Good day guys especially to Mr. Nick...I have another problem..I uploaded the code and the video... When I try to add the nested for loop the program doesn't run.. :(

http://www.mediafire.com/?l3j7jwg0fj295lc

please help...

I’m sorry but I’m not downloading a 11.77 Mb file codenvid.rar file from someone I don’t know. Just post the code.

Put it between [code][/code] tags.

You can do that by hitting the # button above the posting area.

I am sorry Mr. Nick, I included a video on that file so thats why it was 11 mb… This is the code… I remove the interrupt Mr. Nick because I already know how to use the remote, you just needed a delay before the if statement…

void loop() 
  {	
     
    display_word(1,your_text,11,40); 
    
    irrecv.resume();
    digitalWrite(3,HIGH);
    delay(3000);
    digitalWrite(3,LOW);
    if(irrecv.decode(&results))
   if(results.value==16720095)
   {
     digitalWrite(3,LOW);
    counter=0;
    count=0;
    irrecv.resume(); 
    while(true)  // loop until right button pressed ??
      {
        irrecv.resume();
        delay(3000);
     if(irrecv.decode(&results))
      {
     
     
        
      if (results.value==16720095) 
        break;
     
      if(results.value==16763445)
      {
        array[count]=counter;
        
        if(count!=11)
        count=count+1;
        counter=0;
        digitalWrite(3,HIGH);
        delay(1000);
        digitalWrite(3,LOW);
        irrecv.resume();
      }
      if(results.value==16773645)
      {
        if(counter!=53)
        counter=counter + 1;
        else
        counter=0;
        
        digitalWrite(3,HIGH);
        delay(1000);
        digitalWrite(3,LOW);
        irrecv.resume();
      }
      if(results.value==16755285)
      {
        if(counter==0)
        counter=52;
        else
        counter=counter - 1;
        
        digitalWrite(3,HIGH);
        delay(1000);
        digitalWrite(3,LOW);
        irrecv.resume();
      }
      if(results.value==16747125)
      {
        
      }
      }
     }
  
   set=1;
    }
    //if(set==1)
    //{
     // for(int k = 0;k < 11;k++){
      //for(int j = 0;j < 9;j++)
      //{
       // dummy=array[k];
        //your_text[k][j]=dummy_array[dummy][j];
     //}
      //}
      //set=0;
   
  //  }
    
  }

and when i put this nested loop, the program or my led signage wont display…:frowning:

if(set==1)
    {
      for(int k = 0;k < 11;k++){
      for(int j = 0;j < 9;j++)
      {
        dummy=array[k];
        your_text[k][j]=dummy_array[dummy][j];
     }
      }
      set=0;
   
    }

Can you show the whole thing please?

        dummy=array[k];
        your_text[k][j]=dummy_array[dummy][j];

How is array defined? your_text? dummary_array?

Here is the whole code Mr. Nick...dummy_array is defined as byte...

int latchPin = 10; //latch pin of the shift register
int clockPin = 13; //clock pin of the shift register
int dataPin = 11; //data pin of the shift register
int clock = 9; //clock pin of the 4017 counter
int Reset = 8; //reset pin of the 4017 counter
int RECV_PIN = 12;
IRrecv irrecv(RECV_PIN);
decode_results results;
// setting the pins for easy operation with PORTB
int latchPinPORTB = latchPin - 8;
int clockPinPORTB = clockPin - 8;
int dataPinPORTB = dataPin - 8;
int i = 0;
//int j = 0;
//int k = 0;
int set = 0;
int dummy = 0;
int STOP=0;
byte scrolling_word[9][10];// this is for the scrolling text
int array_turn=0;
byte dummy_array[53][9]={SPACE,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,LA,LB,LC,LD,LE,LF,LG,LH,LI,LJ,LK,LL,LM,LN,LO,LP,LQ,LR,LS,LT,LU,LV,LW,LX,LY,LZ};
byte your_text[11][9]={E,N,G,I,N,E,E,R,I,N,G};//PUT YOU TEXT HERE
int array[11];
int counter=0;
int count=0;


void setup(){
  Serial.begin(9600);//starting communicatino with the PC at 9600 boud
  // config for all the pins
  pinMode(dataPin,OUTPUT);
  pinMode(clockPin,OUTPUT);
  pinMode(latchPin,OUTPUT);
  pinMode(clock,OUTPUT);
  pinMode(Reset,OUTPUT);
  pinMode(3,OUTPUT);
 irrecv.enableIRIn(); 
  //reseting the 4017 counter
  digitalWrite(Reset,HIGH);
  digitalWrite(Reset,LOW);
  setupSPI();//starting SPI communication 
  
}

I cant post all the code Mr. Nick, It says that it exceeds the limit....

Well THIS is interesting …

I was checking if you are running out of memory here:

byte scrolling_word[9][10];// this is for the scrolling text

byte dummy_array[53][9]={SPACE,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,LA,LB,LC,LD,LE,LF,LG,LH,LI,LJ,LK,LL,LM,LN,LO,LP,LQ,LR,LS,LT,LU,LV,LW,LX,LY,LZ};

byte your_text[11][9]={E,N,G,I,N,E,E,R,I,N,G};//PUT YOU TEXT HERE

Working out that: (9 * 10) + (53 * 9) + (11 * 9) = 666

666! Well no wonder.

Seriously, though, what is “array” used for? Have you thought about using better data names? An array called “array” is like a variable called “variable”. Not very helpful.

Im very sorry Mr. Nick,so what do I do Mr. Nick?

The scrolling_word is used for scrolling the message, the dummy_array is used as the dummy storage to all data letters and numbers while the your_text is used as the storage of the message Mr. Nick...

Well Mr. jogz44, you don't just describe it, you post code to show it. What is "array" used for?