I see I just updated the code using a digital reading as it seems to give a way more accurate response.
//
//
//
// --a--
// f | | b
// |--g--| for reference
// e | | c
// --d--
// Define the LED digit patterns, from 0 - 9
// { a,b,c,d,e,f,g }
// Arduino pin: 2,3,4,5,6,7,8
int uparray []={
1,0,0,1,1,1,1,
0,0,1,0,0,1,0,
0,0,0,0,1,1,0,
1,0,0,1,1,0,0,
0,1,0,0,1,0,0,
0,1,0,0,0,0,0,
0,0,0,1,1,1,1,
0,0,0,0,0,0,0,
0,0,0,0,1,0,0,
0,0,0,0,0,0,1
};
int pin9 = 9;
int sensorPin = 12; // selects the digital input pin for the IR transmitter/receiver
int sensorValue = 0; // varible that stores the value coming from the sensor
void setup() {
for (int t=2;t<9;t=t+1){
pinMode (t,OUTPUT);}
digitalWrite (pin9, 1); // controls dot - currently set off.
Serial.begin(9600);
}
void loop() {
sensorValue = digitalRead(sensorPin); // reads the value from IR transmitter/receiver
int k=0;
for (int t=0;t<10;t++){
for (int j=2;j<9;j++){
digitalWrite (j, uparray[k]);
if (sensorValue == LOW) {
k=k+1;
//k=k+1;
}
}
delay(1000);}
Serial.println(sensorValue);
}
}
Going to see if I can implement your code somehow.
Thanks for helping, I have to present this tomorrow so all help is truly appreciated.