i want something like
int i = 0;
void setup(){
Serial.begin(9600);
}
void loop(){
if(Serial.available()){ // if i input 1 to serial
i = Serial.parseInt();
}
Serial.println(i); // i want my variable is set to 1 and display a list of 1
// if Serial change to 2, my value will change and display a list of 2
}
I'm new with arduino and don't know the best way to do this ![]()