#include "motors.h"
#include "vend.h"
+const u8 motor_lookup[80] =
+{ 1,12,23,34,46,57,68,79,
+ 11,22,33,44,56,67,78,89,
+ 21,32,43,54,66,77,88,99,
+ 31,42,53,64,76,87,98,
+ 9,41,52,63,74,86,97,
+ 8,19,51,62,73,84,96,
+ 7,18,29,61,72,83,94,
+ 6,17,28,39,71,82,93,
+ 4,16,27,38,49,81,92,
+ 3,14,26,37,48,59,91,
+ 2,13,24,36,47,58,69,
+};
+
void motor_shift_send(u8 data) {
u8 i;
/* load it in, MSB first */
else
bclr_misc_output(A3800_MOTOR_DATA);
+ delay(1);
+
/* clock pulse */
bset((void*)&_io_ports[M6811_PORTA], PORTA_MOTOR_CLOCK);
+ delay(1);
bclr((void*)&_io_ports[M6811_PORTA], PORTA_MOTOR_CLOCK);
+ delay(1);
data = data << 1;
}
bclr((void*)&_io_ports[M6811_PORTA], PORTA_MOTOR_CLOCK);
bclr_changer_output(A3000_MOTOR_ROW_DISABLE);
+ bclr((void*)&_io_ports[M6811_PORTA], PORTA_MOTOR_COL_DISABLE);
}
void motors_off() {
}
u8 dispense_motor(u8 slot) {
- if (!is_motor(slot)) return MOTOR_NOSLOT;
+ //if (!is_motor(slot)) return MOTOR_NOSLOT;
motor_on(slot);
+ delay(1000);
+ motors_off();
+ return MOTOR_SUCCESS;
if (!left_home(slot)) {
motors_off();