We've used an adruino code in our project on an old computer. Now we are using a new computer (with windows 11) and copied the arduino file to the new computer. But when we upload the code to the arduino the error A15 was not declared in this scope appeared. How can i solve this? i am not an expert in arduino, an intern wrote this code (see below).
// Define sensor ports. Note the reverse order.
const int Sensor1 = A15;
const int Sensor2 = A13;
const int Sensor3 = A11;
const int Sensor4 = A9;
const int Sensor5 = A7;
const int Sensor6 = A5;
const int Sensor7 = A3;
const int Sensor8 = A1;
const int Sensor9 = A0;
void setup() {
Serial.begin(9600);
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(A3, INPUT);
pinMode(A5, INPUT);
pinMode(A7, INPUT);
pinMode(A9, INPUT);
pinMode(A11, INPUT);
pinMode(A13, INPUT);
pinMode(A15, INPUT);
}
void loop() { // Loops very fast
int sensorValue1 = analogRead(Sensor1);
float voltage1 = sensorValue1 * (5 / 1024.000); // Here 3.953 is a calibrated value
int sensorValue2 = analogRead(Sensor2);
float voltage2 = sensorValue2 * (5 / 1024.000);
int sensorValue3 = analogRead(Sensor3);
float voltage3 = sensorValue3 * (5 / 1024.000);
int sensorValue4 = analogRead(Sensor4);
float voltage4 = sensorValue4 * (5 / 1024.000);
int sensorValue5 = analogRead(Sensor5);
float voltage5 = sensorValue5 * (5 / 1024.000);
int sensorValue6 = analogRead(Sensor6);
float voltage6 = sensorValue6 * (5 / 1024.000);
int sensorValue7 = analogRead(Sensor7);
float voltage7 = sensorValue7 * (5 / 1024.000);
int sensorValue8 = analogRead(Sensor8);
float voltage8 = sensorValue8 * (5 / 1024.000);
int sensorValue9 = analogRead(Sensor9);
float voltage9 = sensorValue9 * (5 / 1024.000);
Serial.print(voltage1,3);
Serial.print(",");
Serial.print(voltage2,3);
Serial.print(",");
Serial.print(voltage3,3);
Serial.print(",");
Serial.print(voltage4,3);
Serial.print(",");
Serial.print(voltage5,3);
Serial.print(",");
Serial.print(voltage6,3);
Serial.print(",");
Serial.print(voltage7,3);
Serial.print(",");
Serial.print(voltage8,3);
Serial.print(",");
Serial.println(voltage9,3);
delay(360); // Time to wait in miliseconds
}