Hi lost error messages

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Hi lost error messages

1,896件の閲覧回数
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 件の賞賛
返信
3 返答(返信)

1,596件の閲覧回数
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 件の賞賛
返信

1,596件の閲覧回数
Monica
Senior Contributor III

Edward, have you found it already? :smileyhappy:

Regards!

0 件の賞賛
返信

1,596件の閲覧回数
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 件の賞賛
返信