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

                                                                       value=value>>1;

                                                                       value1=value1<<1;

                                                                       speed=maxspeed;

                                                           }

                                               }

                                               if(key==7)

                                               {

                                                           speed=speed-1;

                                                           if(speed==0)

                                                           {

                                                                       speed=maxspeed;

                                                                       if(value==0)

                                                                       {          PORTB=231; value=8; value1=16;}

                                                                       else

                                                                                   PORTB=255-value-value1;

                                                                       value=value>>1;

                                                                       value1=value1<<1;

                                                                       speed=maxspeed;

                                                           }

                                               }

                                               if((keynum==8)&&(PIND==255))

                                               {PORTB=PORTB;

                                               if(key!=10)

                                               {bufkey=key; key=10; keynum=1;}

                                                else

                                                {

                                                key=bufkey;

                                                keynum=1;

                                                }

                                               }

                                    }         

                                    if(PIND!=255) //проверка нажатия

                                    {

                                               if(PIND==254)

                                               {key=1;  speed=maxspeed=8; value=0;}

                                               if(PIND==253)

                                               {key=2;  speed=maxspeed=4; value=0;}

                                               if(PIND==251)

                                               {key=3;  speed=maxspeed=6; value=0;}

                                               if(PIND==247)

                                               {key=4;  speed=maxspeed=3; value=1;}

                                               if(PIND==239)

                                               {key=5;  speed=maxspeed=2; value=1;}

                                               if(PIND==223)

                                               {key=6;  speed=maxspeed=4; value=128; value1=1;}

                                               if(PIND==191)

                                               {key=7;  speed=maxspeed=4; value=8; value1=16;}                                      

                                               if(PIND==127)

                                               {keynum=8;}

                                    }

                        resetTimer0();            // сброс таймера

                        }

            }

            return 0;

}

3. Список литературы.

1. Евстифеев А.В. Микроконтроллеры AVR семейств Tiny и Mega фирмы ATMEL, 4-е изд., стер. – М.: Издательский дом “Додека-XXI”, 2007. -560с.

2. Хартов В.Я. Микроконтроллеры AVR. Практикум для начинающих. – М.: Изд-во МГТУ им. Н.Э. Баумана, 2007. – 240 с.: ил.