0

I need to send an amount of numbers given by the user from Java to an Arduino UNO.

The numbers have to be random.

I had this two ideas:

  1. Send the numbers one by one

    for(int count = 0; count< amount; count++){                             
        Arduino.sendData(array[count]);
    }
    
  2. Write a TXT file with the numbers and read one by one from there.

Questions:

  • Is there anyway to just send the array?

  • If using the option 1, I need to do an input = Serial.read(); everytime a new number is sent?

  • In option 2, if I can open the txt file and read one by one, can it be done without a SD card? (reading the file from PC)

  • Is there another way (not necessarily easier) to do it?

gre_gor
  • 6,669
  • 9
  • 47
  • 52

1 Answers1

1

You can send it.

  1.  

    Arduino.sendData(array);
    
  2.  

    public void sendData(int array[])
    {
    
    }
    
gre_gor
  • 6,669
  • 9
  • 47
  • 52