error: expected unqualified-id before numeric constant

Hi. I am new to programming. I can not get rid of this error : error: expected unqualified-id before numeric constant. Can somebody help me? This program is for this display : https://www.kingbrightusa.com/images/catalog/spec/TA12-11EWA.pdf. Here is the code :

int R1=2,R2=3,R3=4,R4=5,R5=6,R6=7,R7=8; 
int S1=9,S2=10,S3=11,S4=12,S5=13; 
int pins[12]={R1,R2,R3,R4,R5,R6,R7,S1,S2,S3,S4,S5};
int riadok[7]={R7,R6,R5,R4,R3,R2,R1}; 
int stlpec[5]={S1,S2,S3,S4,S5};
int cas=100;
int cas1=25;
unsigned long time;

byte S[5]={B10011011,B01101101,B01101101,B01101101,B10110011};
byte T[5]={B01111111,B01111111,B00000001,B01111111,B01111111};
byte A[5]={B10000001,B01110111,B01110111,B01110111,B10000001}; 
byte R[5]={B00000001,B01110111,B01110111,B01110111,B10001001}; 
byte 0[5]={B10000011,B01111101,B01111101,B01111101,B10000011};  
byte P[5]={B00000001,B01110111,B01110111,B01110111,B10001111}; 

void setup() {
  for(int i=0;i<12;i++)
     pinMode(pins[i],OUTPUT);  
  for(int i=0;i<7;i++) 
     digitalWrite(riadok[i],HIGH);
  for(int i=0;i<5;i++)
     digitalWrite(stlpec[i],LOW);
pinMode(13,INPUT);
}

void zobraz_znak(byte pole_znaku[5],int cas_znaku)    
{
  time=millis();
  while((millis()-time)<=cas_znaku)
  {
    for(int i=0;i<5;i++)
    {  
      digitalWrite(stlpec[i],HIGH);
      for(int j=0;j<7;j++)
        digitalWrite(riadok[j],bitRead(pole_znaku[i],j+1));  
      delay(2);
      for(int j=0;j<7;j++)
        digitalWrite(riadok[j],HIGH);  
      digitalWrite(stlpec[i],LOW);
    }
  }
}
void loop()
{
  for(int i=0;i<5;i++)
  {
    zobraz_znak(S,cas);
    delay(cas1); 
    zobraz_znak(T,cas);
    delay(cas1);
    zobraz_znak(A,cas);
    delay(cas1);
    zobraz_znak(R,cas);
    delay(cas1);
    zobraz_znak(T,cas);
    delay(cas1);
  }}
  time=millis();
  while((millis()-time)<=cas_znaku)

Can you explain that bit of code, please?

byte 0[5]={B10000011,B01111101,B01111101,B01111101,B10000011};

The declaration byte O[5] needs to use the capital O rather than the numerical zero. When I make that change the program compiles.

Interestingly, The code postings in the forum show different characters O and 0, but in the sketch window of IDE 1.6.0 there is no difference in the capital letter and the zero.

This code generates the same error:

byte 

0[5]={B10000011,B01111101,B01111101,B01111101,B10000011}; 


void setup()
{}

void loop()
{}

In the Arduino IDE (sadly) the capital letter 'O' and the zero '0' look the same.

Print in a different font to spot the error:

byte 0[5]={B10000011,B01111101,B01111101,B01111101,B10000011};

void setup() {}

void loop() {}

Doh, I type too slowly!

Switch on the line numbering on the latest IDE.

Load my simplified sketch.

The error is at line 6?

Lesson learnt = watch out for misleading error messages. The error is NOT always where it tells you! Or is it... if you know what the code "looks like" to the compiler?

One way to track down errors like this is to cut out or comment out large swathes of code and see if the error message disappears, if it does then the missing code contained the error.

The bad news is that cutting out code can cause lots and lots more error messages if not done with care.

This is a very crude way of isolating a problem where error messages are misleading but my simplified code makes the point. Where else can the error be?

Can the IDE font be selected? Never tried that!

rowboteer,

I am using IDE 1.6.0 and when I run your sketch is get

sketch_apr12b.ino:3:1: error: expected unqualified-id before numeric constant

which says the error is line 3 position 1. When I run the OP's sketch, I get

sketch_apr12a.ino:14:6: error: expected unqualified-id before numeric constant

which says the error is line 14, position 6 , i.e. after the word byte and the space.

Yes your are right, I misread the error message!

I'm just trying the "Use external editor" option of the IDE with Windows Crimson Editor set to C++ syntax. Never used that feature of the IDE before. The font can be selected to have different 0 from O.

Not quite so convenient but I like it!

AWOL:   time=millis();   while((millis()-time)<=cas_znaku)

Can you explain that bit of code, please?

You are joking? Is that the only bit you did not understand?

No, I'm not joking, just a brain-fart and a small phone screen.

cattledog: byte 0[5]={B10000011,B01111101,B01111101,B01111101,B10000011};

The declaration byte O[5] needs to use the capital O rather than the numerical zero. When I make that change the program compiles.

Interestingly, The code postings in the forum show different characters O and 0, but in the sketch window of IDE 1.6.0 there is no difference in the capital letter and the zero.

THank you! It is working now :) Thank you all for help.

AWOL:
No, I’m not joking, just a brain-fart and a small phone screen.

OK, the while loop will be executed until “cas_znaku” milliseconds have elapsed.

If say cas_znaku is 5000, then the loop would execute for 5 seconds.

The trick is to avoid the 49 day ‘unsigned long’ overflow problem for comparing times. This approach looks correct to me but I often have to go back to past code to make sure!