Grumpy_Mike:
Linear code is easier for me to read and write quickly
Yes you write it quickly and you don't think about what you are writing and you can't read what you have written and so you have problems. You post the code and people take one look at it and give up thinking this guy will never learn anything.
Just as an exercise I wrote your setup code a lot shorter, it is here:-
int segmenta[] = {52, 36, 35, 51};
int segmentb[] = {50, 34, 33, 49};
int segmentc[] = {48, 32, 31, 47};
int segmentd[] = {46, 30, 29, 45};
int segmente[] = {44, 28, 27, 43};
int segmentf[] = {42, 26, 25, 41};
int segmentg[] = {40, 24, 23, 39};
int segment[7][4] = {52, 36, 35, 51,
50, 34, 33, 49,
48, 32, 31, 47,
46, 30, 29, 45,
44, 28, 27, 43,
42, 26, 25, 41,
40, 24, 23, 39 };
char digit1, digit2, digit3, digit4;
void setup(){
Serial3.begin(9600);
Serial3.print('v');
for(int i = 5; i<13; i++){
pinMode(i, INPUT);
digitalWrite(i, HIGH);
}
for(int i = 22; i<54; i++){
pinMode(i, OUTPUT);
digitalWrite(i, LOW);
}
for(int i = A0; i<=A9; i++){
pinMode(i, INPUT);
digitalWrite(i, HIGH);
}
for (int j=0;j<4;j++){
for(int i=0; i<7; i++){
digitalWrite(segment[i][j],HIGH);
delay(50);
digitalWrite(segment[i][j], LOW);
}
}
}
Not tested because I haven't got your hardware but it compiles.
> They are all connected together I promise you
> alright, fixed connections
So what was wrong and why did you not see it the first time. This will be really good information to have to add to the bank of things to tell people to try.
Dose wiggle mean you have to wiggle the wires?
I had missed a jumper from switch 1 to switch 2. simple mistake. wiggle = wiggle switch
I'm checking with multimeter right now. I'm using flat facing up as a reference and turning clockwise (CCW as i see it, since I have it upside down). I'm measuring right at the breadboard the switches are on.
patterns should be 8421
digit4:
up: HLHL (should be 5)
pos1: HLLH displays 9 (should be 6)
pos2: HLLL displays 8 (should be 7)
pos3: LHHH displays 7 (should be 8)
pos4: LHHL displays 6 (should be 9)
pos5: HHHH displays 7 (should be zero)
pos6: HHHL displays 7 (should be 1)
pos7: HHLH displays 7 (should be 2)
pos8: HHLL displays 7 (should be 3)
pos9: HLHH displays 8 (should be 4)
based on that one digit alone, I need to re-check my algorithm methinks..
Also, that setup reduction is why you're the professor & I'm the pupil....