ivanseidel / LinkedList

🔗 A fully implemented LinkedList made to work with general Microcontrollers and Arduino projects
MIT License
350 stars 118 forks source link

A strange problem. #18

Closed GerrieWell closed 2 years ago

GerrieWell commented 7 years ago
LinkedList<int> mMagBiasX = LinkedList<int>();
void magcalMPU9250_2() {
    int sample_count;
    Serial.println("Mag Calibration ");
    mMagBiasX.clear();
    for(;;){

//      Serial.println(mag_temp[0]);
        int t = 0;
        //memcpy(&t,&mag_temp[0],sizeof(int16_t));      #2
        t = -1; //t =mag_temp[0];                                          #1
        mMagBiasX.add(t);
//      delay(135);  // at 8 Hz ODR, new mag data is available every 125 ms
        delay(16);
        //if(calibBut.uniquePress())
        //  break;
        Serial.println(sample_count);
        Serial.println(mMagBiasX.size());
    }
}

Just copy this function to SimpleIntegerList.pde . and call it from setup .Then the loop will stuck at about the 176th call (Arduino uno). and comment # 1 line out ,u will see the loop work again . I don't know why .Maybe relative to the memory ,so maybe it is arduino false . I don't know and give up .Just hope you notice this.

ivanseidel commented 2 years ago

Closing, since a few improvements have been made.