Commit 13e411d9 authored by Tim Soderstrom's avatar Tim Soderstrom

Switched to %ages over RPM

parent 498caa00
......@@ -49,11 +49,18 @@
// Manual Temperature Adjustment Steps
#define TEMP_ADJUSTMENT_PRECISION 0.1
// Specified Motor RPM
#define MOTOR_RPM 76
// #define MOTOR_RPM 76
// Motor Start Percentage
#define MOTOR_START_PCT 100
// Slowest Motor Will Turn
#define MOTOR_MIN_RPM 24
// #define MOTOR_MIN_RPM 24
#define MOTOR_MIN_PCT 50
// How long to free spin motor when changing direction
#define COAST_MOTOR_MILLIS 500
// #define COAST_MOTOR_MILLIS 500
#define COAST_MOTOR_MILLIS 750
// How many seconds between direction changes
#define DEFAULT_DIRECTION_INTERVAL 10
// PID Window Size
#define PID_WINDOW_SIZE_MILLIS 5000
......@@ -153,19 +160,19 @@ const DevProcess process[] =
}
},
{
"Test",
75,
10,
41.1,
5,
{
{"Develop", 600, RED},
{"Stop", 60, YELLOW},
{"Bleach", 180, VIOLET},
{"Fix", 180, WHITE},
{"Rinse", 60, WHITE}
"Test",
75,
10,
41.1,
5,
{
{"Develop", 600, RED},
{"Stop", 60, YELLOW},
{"Bleach", 180, VIOLET},
{"Fix", 180, WHITE},
{"Rinse", 60, WHITE}
}
}
}
};
DevProcess currentProcess;
......
......@@ -162,13 +162,14 @@ void preheat()
void runMotor()
{
byte rpm = MOTOR_RPM;
byte directionInterval = 5;
// byte rpm = MOTOR_RPM;
byte rpm = MOTOR_START_PCT;
byte directionInterval = DEFAULT_DIRECTION_INTERVAL;
bool runMotor = true;
char buffer[32];
byte button=0;
sprintf(buffer, "RPM %02d : I %02d", rpm, directionInterval);
sprintf(buffer, "%02d%% : I %02d", rpm, directionInterval);
drawDisplay("Turning Rotary", buffer);
while(true)
{
......@@ -184,14 +185,16 @@ void runMotor()
{
case BUTTON_UP:
{
if(rpm < MOTOR_RPM)
//if(rpm < MOTOR_RPM)
if(rpm < 100)
++rpm;
button = 0;
break;
}
case BUTTON_DOWN:
{
if(rpm > MOTOR_MIN_RPM)
//if(rpm > MOTOR_MIN_RPM)
if(rpm > MOTOR_MIN_PCT)
--rpm;
button = 0;
break;
......@@ -223,7 +226,7 @@ void runMotor()
}
if(runMotor)
{
sprintf(buffer, "RPM %02d : I %02d", rpm, directionInterval);
sprintf(buffer, "%02d%% : I %02d", rpm, directionInterval);
drawDisplay("Running Motor", buffer);
}
}
......@@ -240,7 +243,8 @@ void heatAndMotor()
char bottomBuffer[32];
bool selectTemp = true;
bool runMotor = true;
byte rpm = MOTOR_RPM;
//byte rpm = MOTOR_RPM;
byte rpm = MOTOR_START_PCT;
byte directionInterval = 5;
while(selectTemp)
......@@ -288,7 +292,7 @@ void heatAndMotor()
sprintf(topBuffer, "%sC / %sC", currentTempChar, targetTempChar);
if(runMotor)
{
sprintf(bottomBuffer, "RPM %02d I %02d", rpm, directionInterval);
sprintf(bottomBuffer, "%02d%% : I %02d", rpm, directionInterval);
drawDisplay(topBuffer, bottomBuffer);
}
else
......@@ -304,14 +308,16 @@ void heatAndMotor()
{
case BUTTON_UP:
{
if(rpm < MOTOR_RPM)
// if(rpm < MOTOR_RPM)
if(rpm < 100)
++rpm;
button = 0;
break;
}
case BUTTON_DOWN:
{
if(rpm > MOTOR_MIN_RPM)
// if(rpm > MOTOR_MIN_RPM)
if(rpm > MOTOR_MIN_PCT)
--rpm;
button = 0;
break;
......@@ -352,7 +358,7 @@ void heatAndMotor()
}
controlMotor(rpm, directionInterval);
sprintf(topBuffer, "%sC / %sC", currentTempChar, targetTempChar);
sprintf(bottomBuffer, "RPM %02d I %02d", rpm, directionInterval);
sprintf(bottomBuffer, "%02d%% : I %02d", rpm, directionInterval);
drawDisplay(topBuffer, bottomBuffer);
}
}
......
......@@ -136,13 +136,16 @@ void changeDirection()
}
}
/*
int toRPM(byte value)
{
return map(value, 0, 255, 0, MOTOR_RPM);
}
*/
int toSpeed(byte value)
{
return map(value, 0, MOTOR_RPM, 0, 255);
// return map(value, 0, MOTOR_RPM, 0, 255);
// Changing to percent over raw RPMs
return map(value, 0, 100, 0, 255);
}
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