Ok Tried to work through the array idea. Code below. Compiles with 4,262 bytes. Haven't included it the main code yet, because it requires a lot of changes to it, and I wan't to make sure I've got the array working first.
To define the task:
I want to it to read the potentiometer,
Remap those values (0-1023), to a series of cases (0-19), which are in the array 'avals'
Then depending on what value comes back after smoothing using the (ADJUSTpot/10) *10 look for which case this is in and set the values of Out and In to a series of numbers, which are now included in the array 'manouts' and 'manints'.
In the second 'potrequest2', I plan to have it set values, previously set manually, from 10-9999, with bigger increments as the number goes higher (those numbers are commented out at the bottom for the moment).
I'm not sure if this code is doing this, appreciate if anyone can point out my mistake or the many mistakes.
#define NOS (19)
int main(){}
uint8_t PotChanged;
uint8_t ManuDIR;
int avals[NOS] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18}; /////////// Case Arrays
int manouts[NOS] = {200, 120, 80, 40, 20, 10, 5, 3, 1, 0, -1, -3, -5, -10, -20, -40, -80, -120, -200}; /////////////Values for MANout
int manints[NOS] = {-200, -120, -80, -40, -20, -10, -5, -3, -1, 0, 1, 3, 5, 10, 20, 40, 80, 120, 200}; /////////////Values for MANin
void potrequest1()
{
// int a = analogRead(A0);
int ADJUSTpot = analogRead(A0);
ADJUSTpot = ((ADJUSTpot/10)*10);
int vINTERVAL = map(ADJUSTpot, 0, 1023, 0, 19);
int MANout;
int MANin;
for (int i=1; i<NOS; i++)
{
if (ADJUSTpot <= avals[i])
{
int n1 = ADJUSTpot-avals[i-1];
int n2 = avals[i]-avals[i-1];
MANout = manouts[i-1] + (n1*(manouts[i]-manouts[i-1]))/(n2);
MANin = manints[i-1] + (n1*(manints[i]-manints[i-1]))/(n2);
break;
}
}
}
//if (ManuDir==100){
// displaydigits(ManuOUT);
//}
#define INT (86400)
void potrequest2(){
int pot2;
int vINTERVAL;
int INTERVAL;
pot2 = (1+vINTERVAL)*30;
INTERVAL = vINTERVAL+1;
}
#
void potrequest3(int dog){
int pot3;
// int a = analogRead(A0);
int ADJUSTpot = analogRead(A0);
int vINTERVAL;
int INTERVAL;
pot3 = (1+vINTERVAL)*10;
INTERVAL = vINTERVAL+1;
}
// int INTERVAL[] = {1, 2, 3, 4, 5, 6,7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
//20, 25,30, 35, 40, 45, 50, 55, 60, 75, 90, 105, 120, 135, 150, 165, 180, 195, 210, 225, 240, 255, 260, 275, 300,
//330, 360, 390, 420, 450, 480, 510, 540, 570, 600, 660, 720, 780, 840, 900, 960, 1020, 1080, 1140, 1200, 1260, 1320,
//1380, 1440, 1500, 1560, 1620, 1680,1740, 1800, 2100, 2400, 3000, 3600, 5400, 7200, 9000, 10800, 12600, 14400, 18000,
//21600, 28800, 43200, 86400};
Thanks for the help in advance.