My code
String serial;
int dotLocation[] = {};
int a = 0;
int r = 0;
int g = 0;
int b = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
serial = Serial.readString();
for(int i = 0;i<serial.length();i++) {
if (serial.charAt(0) == 'i') {
while(serial.charAt(i) == isAlphaNumeric) {
Serial.println(i);
a = serial.charAt(i);
}
}
Serial.println(a);
}
}
So my problem is that i want every number after i to be added to the variable a;
But for some reason it doesn't add anything so the value of that variable stays at 0;
Can you guys take a look at my code and tell what's wrong. I am in a kind of a hurry because i would want my code to be finished in time for a demoparty.