on off switch

Status
Not open for further replies.
At its crudest, you could start with



#include <8051.h>
void main()
{
while (1) // do forever
{
P2_0 = P1_0;// copy switch input to output
}
}

This will just copy the current switch state to the output and takes no account of switch bouncing.

You'll have to imagine the indenting!
 
Last edited:

I hope this will work.....
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…