Skip to main content

Abo Array About Arrays in Arduino

I have a question about arrayarrays in Arduino. Sorry for my bad English. I want to postput numbers in an array,and and I think belowthe code below works properly. However

However,it don't it doesn't work and corrupted numbers flowsshow up in the Serial monitor. Even "delay(1000)" don't Even delay(1000) doesn't work.

If I changed "ND_MAC[i]=128;"change ND_MAC[i]=128; to "ND_MAC[i]=126;", it works properly. So So I'm wondering if this array is char type,but but I designate int to array. How to solve it?

int ND_MAC[7];

char i=0;

void setup() {

Serial.begin(9600);

}

void loop() {

for(i=0;i<8;i++){

ND_MAC[i]=128;

Serial.print(ND_MAC[i],HEX);

}

Serial.println();

delay(1000);

}

int ND_MAC[7];
char i=0;
void setup() {
  Serial.begin(9600);
}
void loop() {
  for(i=0;i<8;i++){
    ND_MAC[i]=128;
    Serial.print(ND_MAC[i],HEX);
  }
  Serial.println();
  delay(1000);
}

Abo Array in Arduino

I have a question about array in Arduino. Sorry for bad English. I want to post numbers in array,and I think below code works properly. However,it don't work and corrupted numbers flows in Serial monitor. Even "delay(1000)" don't work.

If I changed "ND_MAC[i]=128;" to "ND_MAC[i]=126;", it works properly. So I'm wondering if this array is char type,but I designate int to array. How to solve it?

int ND_MAC[7];

char i=0;

void setup() {

Serial.begin(9600);

}

void loop() {

for(i=0;i<8;i++){

ND_MAC[i]=128;

Serial.print(ND_MAC[i],HEX);

}

Serial.println();

delay(1000);

}

About Arrays in Arduino

I have a question about arrays in Arduino. Sorry for my bad English. I want to put numbers in an array, and I think the code below works properly.

However, it doesn't work and corrupted numbers show up in the Serial monitor. Even delay(1000) doesn't work.

If I change ND_MAC[i]=128; to "ND_MAC[i]=126;", it works properly. So I'm wondering if this array is char type, but I designate int to array. How to solve it?

int ND_MAC[7];
char i=0;
void setup() {
  Serial.begin(9600);
}
void loop() {
  for(i=0;i<8;i++){
    ND_MAC[i]=128;
    Serial.print(ND_MAC[i],HEX);
  }
  Serial.println();
  delay(1000);
}
Source Link

Abo Array in Arduino

I have a question about array in Arduino. Sorry for bad English. I want to post numbers in array,and I think below code works properly. However,it don't work and corrupted numbers flows in Serial monitor. Even "delay(1000)" don't work.

If I changed "ND_MAC[i]=128;" to "ND_MAC[i]=126;", it works properly. So I'm wondering if this array is char type,but I designate int to array. How to solve it?

int ND_MAC[7];

char i=0;

void setup() {

Serial.begin(9600);

}

void loop() {

for(i=0;i<8;i++){

ND_MAC[i]=128;

Serial.print(ND_MAC[i],HEX);

}

Serial.println();

delay(1000);

}