Oook using your code like this:
//
//
//
// --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, // Sets display to 1
0,0,1,0,0,1,0, // Sets display to 2
0,0,0,0,1,1,0, // Sets display to 3
1,0,0,1,1,0,0, // Sets display to 4
0,1,0,0,1,0,0, // Sets display to 5
0,1,0,0,0,0,0, // Sets display to 6
0,0,0,1,1,1,1, // Sets display to 7
0,0,0,0,0,0,0, // Sets display to 8
0,0,0,0,1,0,0, // Sets display to 9
0,0,0,0,0,0,1 // Sets display to 0
};
/*
int pin2 = 2;
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;
int pin6 = 6;
int pin7 = 7;
int pin8 = 8;
*/
int pin9 = 9;
int sensorPin = 12; // selects the analogue input pin for the IR transmitter/receiver
int sensorValue = 0; // varible that stores the value coming from the sensor
int currentValue = 0;
int k=0; // sets position of array
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
boolean changeLED = false;
if (sensorValue == 0) {
changeLED = true;
currentValue = currentValue + 1;
if (currentValue >9){
currentValue = 0;
}
}
if (changeLED == true){
//for (int t=0;t<10;t++){
for (int j=2;j<9;j++){
digitalWrite (j, ((uparray[j][currentValue] & 1 == 1 ? HIGH : LOW));
}
Serial.println(sensorValue);
}
}
Its giving me these errors:
sketch_mar22a.cpp: In function 'void loop()':
sketch_mar22a:62: error: invalid types 'int[int]' for array subscript
I'm quite the noob so I'm not too sure what its saying.