Salve ragazzi, ho fatto le mie ricerche nel forum ed ho adattano ciò che mi serviva. Devo fare la conversione da hex a decimale. Non so dove sbaglio, ho fatto varie prove con numeri sballati , potreste darci uno sguardo ?
int id_dec = 0;
int val = 0;
String id_string= incString.substring(0,index);
for(int i=0; i<3; i++){
if(id_string[i] == "A"){
val = 10;
}else if (id_string[2-i] == "B"){
val = 11;
} else if (id_string[i] == "C"){
val = 12;
}else if (id_string[i] == "D"){
val = 13;
}else if (id_string[i] == "E"){
val = 14;
}else if (id_string[i] == "F"){
val = 15;
} else {
val = id_string[i];
}
id_dec = (int)val * pow(16,i)+ id_dec;
}
Il numero in esadecimale è di tre lunghezze per esempio 19B