From 00df49a7c82111f5f303b846bbfe7b5406c80d6e Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 5 Jul 2016 09:45:25 -0400 Subject: [PATCH] Added arbitrary exposure via buttons --- ino/intval2_1_serial/intval2_1_serial.ino | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ino/intval2_1_serial/intval2_1_serial.ino b/ino/intval2_1_serial/intval2_1_serial.ino index 76a8697..4531159 100644 --- a/ino/intval2_1_serial/intval2_1_serial.ino +++ b/ino/intval2_1_serial/intval2_1_serial.ino @@ -241,14 +241,14 @@ void button_end (int index, long buttontime) { Output(2, 250); } } else if (index == 2) { // set speed - if (buttontime <= 1000) { - fwd_speed = FAST_PWM; - bwd_speed = FAST_PWM; - Output(1, 500); - } else if (buttontime > 1000) { - fwd_speed = SLOW_PWM; - bwd_speed = SLOW_PWM; - Output(2, 250); + if (buttontime >= 1000) { + timed_delay = buttontime - BOLEX_C; + timed = true; + Output(2, 250); + } else if (buttontime < 1000) { + timed_delay = 0; + timed = false; + Output(1, 500); } } else if (index == 3) { //set delay if (buttontime < 42) { @@ -401,3 +401,4 @@ void log (String msg) { Serial.println(msg); } } +