// LAB 5: MOTOR STEPPER // NOTE: tweak this to adjust resolution (feel free to add more bits!) // use pins 14, 15, ..., 13+DAC_RESOLUTION // highest pin is LSB. const uint8_t DAC_RESOLUTION = 2; // set up some initial variables based on the DAC resolution const int HIGHEST_VAL = pow(2, DAC_RESOLUTION)-1; uint8_t PINS[DAC_RESOLUTION] = {0}; const int step_time = 1000; // (milliseconds) bool output_bits[DAC_RESOLUTION] = {0}; void setPins(int num){ // loop over the number, store the bits in an array // (this preprocessing is so that we can hopefully set the pins faster) for (int i=0; i