static struct servo servo_table[] = {
{
- .bit = 0,
+ .bit = 3,
.command = 0,
},
{
- .bit = 1,
+ .bit = 4,
.command = 512,
},
{
- .bit = 2,
- .command = 1023,
+ .bit = 5,
+ .command = 512,
+ },
+ {
+ .bit = 6,
+ .command = 512,
+ },
+ {
+ .bit = 7,
+ .command = 512,
},
};
#define NB_SERVO (sizeof(servo_table)/sizeof(*servo_table))
SIGNAL(TIMER1_COMPA_vect)
{
- PORTC = portval;
+ PORTD = portval;
TIMSK1 &= ~_BV(OCIE1A);
done = 1;
}
DDRB = 0x20;
/* servo outputs */
- DDRC = 0x7;
+ DDRD = 0xf8;
+ DDRB |= 0x01;
/* start timer1 at clk/1 (8Mhz) */
TCNT1 = 0;
}
/* bypass mode */
while (bypass == 1) {
- PORTC = PORTB;
+ PORTD = ((PINC & 0x0f) << 3) | ((PINB & 0x01) << 7);
poll_spi();
}
}