Hi, I am trying to declare a large array to store the data get through the http.
when i declare it uint8_t Image_data_buffer[5808]; before setup(). the whole program does not work.
and I can declare it at the begining of the loop() as follows second part of the codes, it works, I can see the date on COM.but when i want to use this large array like this first part of the codes. even the program did not realy step in this part. the http get request will fail. what wrong ? help me,Thanks a lot!
for(number_frame=0;number_frame<92;number_frame++)
{
Serial_rx_data[0] = number_frame;
for(uint16_t i=1 ;i<data_length+1;i++)
{
Serial_rx_data[i] =Image_data_buffer[i-1];
// Serial_rx_data[i] =i;
Serial.print(Serial_rx_data[i], DEC);
}
/*********************************************************************/
uint8_t Image_data_buffer[5808];
uint16_t number_buffer=0;
if (millis() - lastConnectionTime > postingInterval) {
httpRequest();
}
while (client.available()) {
uint8_t c = client.read();
if(0xd==c&&client.read()==0xa){
c = client.read();
if(c==0xd&&client.read()==0xa)
{
Serial.println("start getting the HEX");
while(1){
c=client.read();
uint8_t high=0;
uint8_t low=0;
if (0x30 == c && 0x78 == client.read()) {
char d = client.read();
if (d >= '0' && d <= '9') {
high= d - '0';
} else if (d >= 'a' && d <= 'f') {
high= d - 'a' + 10;
} else if (d >= 'A' && d <= 'F') {
high= d - 'A' + 10;
} else {
high= -1;
}
d = client.read();
if (d >= '0' && d <= '9') {
low= d - '0';
} else if (d >= 'a' && d <= 'f') {
low= d - 'a' + 10;
} else if (d >= 'A' && d <= 'F') {
low= d - 'A' + 10;
} else {
low= -1;
}
Image_data_buffer[number_buffer]=(high*16) + low;
Serial.print(Image_data_buffer[number_buffer],HEX);
Serial.print(' ');
number_buffer+=1;
if(number_buffer==5808)
{
break;
}
}
}
}
}
}