Commit f75a6184 authored by thcl's avatar thcl
Browse files

Disabled interrupt when we read from pot and when we write to MOSFETs

parent 55855310
......@@ -93,6 +93,10 @@ void motor_setup(void) {
void pot_0_speed_ISR() {
POT_0_VALUE = get_pot_0_scaled(SCALE_FACTOR, PERIOD_OVER_255);
// Serial.print("POT_VALUE: ");
// Serial.print(POT_0_VALUE);
// Serial.println();
}
void turn_all_off() {
......@@ -166,7 +170,7 @@ void set_phase(int high1, int high2, int high3, int low1, int low2, int low3)
high3 = one_to_scaleFactor(high3);
//turn the stuff that should be off, off first
cli();
if (! low1) digitalWrite(L1, low1);
if (! low2) digitalWrite(L2, low2);
if (! low3) digitalWrite(L3, low3);
......@@ -182,6 +186,7 @@ void set_phase(int high1, int high2, int high3, int low1, int low2, int low3)
if (high1) analogWrite(H1, high1);
if (high2) analogWrite(H2, high2);
if (high3) analogWrite(H3, high3);
sei();
}
void set_phase_float(float f1, float f2, float f3)
......@@ -190,7 +195,9 @@ void set_phase_float(float f1, float f2, float f3)
// NOTE: The scale factor of is the max value we want out of
// the potentiometer
//digitalWrite(led, HIGH);// start a timer
cli();
int potval = POT_0_VALUE;
sei();
//digitalWrite(led, LOW);// stop a timer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment