Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/11/08 09:11
Read: times


 
#158176 - sampling
Responding to: ???'s previous message
am sampling the input port using a while(1) infinite loop inside main().

sbit l1=P0^0;
sbit sfwd=P0^2;
sbit srev=P0^3;
sbit l2=P0^1;
sbit tfwd=P0^4;
sbit trev=P0^5;

void a()
{ if((i%2)==0)

{

sfwd=1;
srev=0;
while(!l1);
sfwd=0;
srev=0;

}
else{sfwd=0;srev=0;}
i++;

}

void main()
{
while(1)
{


Key_Scan();
ch = keypad[R][C];

switch (ch)
{case '1' :a();
break;
case '2' :b() ;
break;
case '3' :c();
break;
case '4' :d();
break;
default : break;
}



}
}


List of 22 messages in thread
TopicAuthorDate
HELP:regular monitoring of inputs 8051            01/01/70 00:00      
   Use a timer ?            01/01/70 00:00      
   Explain            01/01/70 00:00      
      NOT WORKING            01/01/70 00:00      
         instant doesn't exist            01/01/70 00:00      
         Make your mind up!            01/01/70 00:00      
            bounce            01/01/70 00:00      
               Sounds strange ...            01/01/70 00:00      
                  sampling            01/01/70 00:00      
                     Please post legible source code            01/01/70 00:00      
                        What debounce?            01/01/70 00:00      
                     code            01/01/70 00:00      
                        Did you check the preview?            01/01/70 00:00      
                        Broken code            01/01/70 00:00      
                           indentation            01/01/70 00:00      
                              Simulation            01/01/70 00:00      
                              Regular            01/01/70 00:00      
   Why not reading from main loop?            01/01/70 00:00      
   PLEASE HELP            01/01/70 00:00      
      have a look at Rate This Post            01/01/70 00:00      
   Study the state machine tutorial...            01/01/70 00:00      
      Is it here?            01/01/70 00:00      

Back to Subject List