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:
Send the numbers one by one
for(int count = 0; count< amount; count++){ Arduino.sendData(array[count]); }
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?