CPP 216
Araye x,y Guest on 9th December 2023 08:07:33 AM
  1.  
  2. void setup() {
  3.   // put your setup code here, to run once:
  4.   Serial.begin(9600);
  5.   Serial.println("x : ");
  6.   while(Serial.available() == 0){}
  7.   int x ;
  8.   x = Serial.parseInt();
  9.   Serial.println("y : ");
  10.   while(Serial.available() == 0){}
  11.   int y ;
  12.   y = Serial.parseInt();
  13.   Serial.println(' ');
  14.   Serial.println(x);
  15.   Serial.println(y);
  16.  
  17.   int mylist[x][y];
  18.   for(int xi = 0 ; xi<x ; xi++){
  19.     for(int yi =0 ; yi < y ; yi++){
  20.       Serial.print('x');
  21.       Serial.print(xi);
  22.       Serial.print('y');
  23.       Serial.println(yi);
  24.       while(Serial.available() == 0){}
  25.       mylist[xi][yi] = Serial.parseInt();    
  26.     } }
  27.     Serial.println("Resalt");
  28.  
  29.       for(int xi = 0 ; xi<x ; xi++){
  30.     for(int yi =0 ; yi < y ; yi++){
  31.       Serial.print('x');
  32.       Serial.print(xi);
  33.       Serial.print('y');
  34.       Serial.println(yi);
  35.  
  36.       Serial.println(mylist[xi][yi]);    
  37.     } }
  38. }
  39.  
  40. void loop() {
  41.   // put your main code here, to run repeatedly:
  42.  
  43. }

Hightechrobo bin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.