Написать программу для включения нескольких светодиодов стенда, страница 2

                while (1)//Loop forever

                {

                               for(j=0;j<1000;j=j+100)

                               {

                                               for(int i=0;i<8;i++)

                                               {

                                                               FIO2PPIN = shag;

                                                               Delay(100+j);

                                                               if(shag!=0x80)

                                                                              shag>>=1;

                                                                else

                                                                              shag=0x00;        

                                               }

                               }

for(int i=0;i<8;i++)

                               {

                                               FIO2PPIN = shag;

                                               Delay(100+j);

                                               if(shag!=0x80)

                                                               shag>>=1;

                                                else

                                                               shag=0x00;        

                               }

                }

Задание 6.

Модифицировать программу, созданную на этапе №4, чтобы скорость движения бегущего огня непрерывно увеличивалась с 1Гц вплоть до предела восприятия 10Гц и затем снова уменьшалась до 1Гц

                shag=0x00;

                while (1)//Loop forever

                {

                               for(j=0;j<1000;j=j+100)

                               {

                                               for(int i=0;i<8;i++)

                                               {

                                                               FIO2PPIN = shag;

                                                               Delay(100+j);

                                                               if(shag!=0x80)

                                                                              shag>>=1;

                                                                else

                                                                              shag=0x00;        

                                               }

                               }

                               Delay(100);

                               for(l=0;l<1000;l=l+100)

                               {

                                               for(int i=0;i<8;i++)

                                               {

                                                               FIO2PPIN = shag;

                                                               Delay(100+j-l);

                                                               if(shag!=0x80)

                                                                              shag>>=1;

                                                                else

                                                                              shag=0x00;        

                                               }

                               }

                }