Si scusa in realtà è fatta così:
if (Serial.available() ) { ser=Serial.read(); if(ser==1) {.....}}
come posso correggere?