Page 148 - MDP2022-3
P. 148

unsigned  char  result;
                    if(rxBufferGP  ==  rxBufferPP)  return  0;
                    result  =  rxBuffer[rxBufferGP++];
                    rxBufferGP  %=  rxBufferMax;

                    return  result;
            }


            void  moveMotor(unsigned  char  inValue)  {
                    if(inValue  ==  'T'){//auto  driving  ==  T


                            //re-load
                            //send  atmega  for  servo
                            //after  boozer

                            Cy_GPIO_Write(boozer_PORT,boozer_NUM,1);

                            Cy_GPIO_Write(ReLoad_PORT  ,  ReLoad_NUM  ,  1);
                            CyDelay(500);
                            Cy_GPIO_Write(boozer_PORT,boozer_NUM,0);
                            Cy_GPIO_Write(ReLoad_PORT  ,  ReLoad_NUM  ,  0);




                    }
                    else  if(inValue  ==  'Y'){  //auto  driving  off  ==  Y
                            //fire
                            Cy_GPIO_Write(fireM1_PORT  ,  fireM1_NUM  ,  1);

                            Cy_GPIO_Write(fireM2_PORT  ,  fireM2_NUM  ,  0);
                            CyDelay(700);
                            Cy_GPIO_Write(fireM1_PORT  ,  fireM1_NUM  ,  0);
                            Cy_GPIO_Write(fireM2_PORT  ,  fireM2_NUM  ,  0);


                    }else  if(inValue  ==  'O'){//Razer
                            RazerFlag  =  !RazerFlag;
                            if(RazerFlag  ==  true){
                                    flag  =  1;
                            }else  {

                                    flag  =  0;
                                    //CyDelay(500);
                            }
                    }

                    else  if(inValue  ==  'J'){
                            Cy_GPIO_Write(Razer_PORT,Razer_NUM,1);
   143   144   145   146   147   148   149   150   151   152   153