Hi lost error messages

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hi lost error messages

995 Views
lost
Contributor I

Hi

I must admit I Amy very lost. In my assignment write to do the following.

  1. Initialize an array with binary numbers 0 to 9. Use a “for loop” to display each array element on the Tower LEDs and have a one-second delay between each display. Define all of the variables as unsigned character. The delay should use inline assembly language.

void main(void)  {

char  dam[10];= {0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39};  // sets the array in decimal 0-9

           unsigned char z;

        DDRB = 0xFF;

         for(z=0;z<10;z++);          // z is going to count the numbers in the array which is 10

         PORTB = dam[z] ;

          DDRT = 0xff;                // should go out to the tower through DDRT to the leds

        delay(1000);                    a delay of about 1 sec for the light on and delay for 1 sec before the next trun on

        PTT= 0x30;

         delay(1000);       

          PTT = dam[z];      

         for(;;);      

       }

Thats no big deal for most people but after 3 1/2 days to write it i'm in trouble . The red line has been giving error C2801 '}' missing . If anyone cord help a lot of thanks will go very far

0 Kudos
Reply
3 Replies

695 Views
lost
Contributor I

Hi it funny out of the 13 of us students 1 has gotten pass this line but she say find it your self. But thanks for the input at lest I got one haha

0 Kudos
Reply

695 Views
Monica
Senior Contributor III

Edward, have you found it already? :smileyhappy:

Regards!

0 Kudos
Reply

695 Views
TomE
Specialist II

Homework. Can't you ask another student for help?

Keep looking at that "red line" until you can see the very obvious syntax error.

Hint. If you don't know where in a long line the problem is, break it into multiple lines (one word per line).

The "for" loop isn't going to work either.

Tom

0 Kudos
Reply