Изучение лабораторного стенда STК500 и написание двух программ на языках программирования ассемблер и С, задействующие все возможности стенда, страница 5

                                               if(key==3)

                                               {

                                                           speed=speed-1;

                                                           if(speed==0)

                                                           {

                                                                       speed=maxspeed;

                                                                       if(value==0)

                                                                       {          PORTB=127; value=127;}

                                                                       else

                                                                                   PORTB=value;

                                                                       value=value>>2;

                                                                       speed=maxspeed;

                                                           }

                                               }

                                               if(key==4)

                                               {

                                                           speed=speed-1;

                                                           if(speed==0)

                                                           {

                                                                       speed=maxspeed;

                                                                       if(value==128)

                                                                       {          PORTB=254; value=1;}

                                                                       else

                                                                                   PORTB=255-value;

                                                                       value=value<<1;

                                                                       speed=maxspeed;

                                                           }

                                               }

                                               if(key==5)

                                               {

                                                           speed=speed-1;

                                                           if(speed==0)

                                                           {

                                                                       speed=maxspeed;

                                                                       if(value==256)

                                                                       {          PORTB=254; value=1;}

                                                                       else

                                                                                   PORTB=255-value;

                                                                       value=value<<2;

                                                                       speed=maxspeed;

                                                           }

                                               }

                                               if(key==6)

                                               {

                                                           speed=speed-1;

                                                           if(speed==0)

                                                           {

                                                                       speed=maxspeed;

                                                                       if(value==8 && value1==16)

                                                                       {          PORTB=126; value=128; value1=1;}

                                                                       else

                                                                                   PORTB=255-value-value1;