לימוד ארדואינו : שיעור 14 – מערכים רב מימדים -קורס C506
לימוד שפת סי – מערכים רב מימדיים .
https://wokwi.com/projects/333759186992104019
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
// לימוד שפת סי , בסביבת ארדואינו קורס C506 // רובוטרוניקס מפתחת תוכנה ואלקטרוניקה - משדרים כרטיסים אלקטרונים // קורסים למהנדסים , בתי ספר , ונוער #include <stdio.h> #include <string.h> void setup() { char buf[100]; //1-D char x[3][3]; //2-D int c,r; // r - row , c -column Serial.begin(9600); x[0][0]='X'; x[0][1]='0'; x[0][2]='0'; x[1][0]='0'; x[1][1]='X'; x[1][2]='0'; x[2][0]='0'; x[2][1]='0'; x[2][2]='X'; Serial.println("Array 2-D"); delay(1000); for(r=0;r<=2;r++) // row index { for(c=0;c<=2;c++) // column { Serial.print(x[r][c]); delay(100); // 150 ms -- ? 1/8 sec } Serial.println(); // new line } } void loop() { // put your main code here, to run repeatedly: } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
// לימוד שפת סי , בסביבת ארדואינו קורס C506 // רובוטרוניקס מפתחת תוכנה ואלקטרוניקה - משדרים כרטיסים אלקטרונים // קורסים למהנדסים , בתי ספר , ונוער #include <stdio.h> #include <string.h> void setup() { char buf[100]; //1-D char x[3][3]; //2-D int c,r; // r - row , c -column Serial.begin(9600); x[0][0]=65; x[0][1]=65; x[0][2]=65; x[1][0]=65; x[1][1]=65; x[1][2]=65; x[2][0]=65; x[2][1]=65; x[2][2]=65; // x[1][1]=65; x[1][1]=x[1][1] +1; // 66 ==> B Serial.println("Array 2-D"); delay(1000); for(r=0;r<=2;r++) // row index { for(c=0;c<=2;c++) // column { Serial.print(x[r][c]); delay(100); // 150 ms -- ? 1/8 sec } Serial.println(); // new line } } void loop() { // put your main code here, to run repeatedly: } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
// https://www.robotronix.co.il // לימוד שפת סי , בסביבת ארדואינו קורס C506 // רובוטרוניקס מפתחת תוכנה ואלקטרוניקה - משדרים כרטיסים אלקטרונים // קורסים למהנדסים , בתי ספר , ונוער #include <stdio.h> #include <string.h> #define SizeTemp 6 float temp[SizeTemp]; void setup() { char buf[100]; char t[4][100]; int i; Serial.begin(9600); // copy strings to array 2-D strcpy(t[0],"www.Robotronix.co.il"); strcpy(t[1],"www.stm.com"); strcpy(t[2],"www.mouser.com"); strcpy(t[3],"www.nxp.com"); Serial.println("searching sites ..."); for(i=0;i<=3;i++) { // sprintf(buf," Serching site : %s",t[i]); // Serial.println(buf); Serial.println(t[i]); delay(1000); // 150 ms -- ? 1/8 sec } } void loop() { // put your main code here, to run repeatedly: } |
1 |
// ww.robotronix.co.il |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
// www.robotronix.co.il // לימוד שפת סי , בסביבת ארדואינו קורס C506 // רובוטרוניקס מפתחת תוכנה ואלקטרוניקה - משדרים כרטיסים אלקטרונים // קורסים למהנדסים , בתי ספר , ונוער #include <stdio.h> #include <string.h> void setup() { char buf[100]; char t[10][100]; int links[10][1]; int images[10][1]; int i; Serial.begin(9600); strcpy(t[0],"www.Robotronix.co.il"); strcpy(t[1],"www.stm.com"); strcpy(t[2],"www.mouser.com"); strcpy(t[3],"www.nxp.com"); links[0][0]=10; links[1][0]=452; links[2][0]=12; links[3][0]=293; images[0][0]=1; images[1][0]=52; images[2][0]=2; images[3][0]=93; Serial.println("Site Summery ..."); for(i=0;i<=3;i++) { sprintf(buf," Serching site : %s",t[i]); Serial.print(buf); Serial.print(" , images :"); Serial.print(images[i][0]); Serial.print(" , Links :"); Serial.println( links[i][0]); delay(1000); // 150 ms -- ? 1/8 sec } } void loop() { // put your main code here, to run repeatedly: } |