Buy an Axon, Axon II, or Axon Mote and build a great robot, while helping to support SoR.
0 Members and 1 Guest are viewing this topic.
while(1){ portb = 0xff; // turn all b ports high delay_us(1500); portb = 0x00; // turn all b ports low delay_us(20000);}
while(1){ portb.5 = 0xff; // turn pb5 high delay_us(1500); portb.5 = 0x00; // turn pb5 low delay_us(20000);}
u08 i;for (i=50; i-->0;) portd.0 = 0xFF portd.1 = 0xFF delay_us(1700) portd.0 = 0x00 portd.1 = 0x00 delay_us(20000)}
void servo_left(signed long int speed) { PORT_ON(PORTD, 0); delay_cycles(speed); PORT_OFF(PORTD, 0); delay_cycles(200); }void servo_right(signed long int speed) { PORT_ON(PORTD, 1); delay_cycles(speed); PORT_OFF(PORTD, 1); delay_cycles(200); }