#include sbit m1=P2^4; sbit m2=P2^5; void delay(unsigned char j); void oscillate(void); void main() { while (1) { oscillate(); } } void oscillate(void) { P2=0x10; delay(5); //45 degree motion P2=0x20; delay(5); } void delay(unsigned char j) { int i; TMOD=0x01; for (i=1;i<=j;i++) { TH0=0x00; TL0=0x00; TR0=1; while ( TF0!=1) { } TF0=0; TR0=0; } }