Arrays of ints

I am trying to capture serial input in the Loop and keep the loop running. To do this I am
if (Serial.available() > 0) {
incomingByte =;

adding into an array and detecting of a CR or 13

once detected running a decrimenting for loop and multiplying each array member by 10 times the previous one. if I read the array members just after they have been written it all ok however when I try to read them in the reverse loop I get garbage.

0,9 0,8 0,7 91,6 0,5 52,4 0,3 -103,2 2,1

read_number.ino (1.35 KB)

  char incomingByte;

It is dumb to use a type (byte) in a name when the name is not that type.


Anonymous printing sucks.

     if ((incomingByte>47)&&(incomingByte<59)){

No need to hunt up a web page if you write the code properly:

     if ((incomingByte >= '0')&&(incomingByte <= '9'))

Heed the fact that I fixed 3 issues with your code.

The commented out code does nothing. DELETE IT.

We have no idea what the input to your program was, or what the output was, because you did not label anything.

We do not know what you expected the output to be.

We do know that you write to arrays without checking that there is room in the array.