Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #11156
    boggydew
    Participant

    Hi, I cant get LowPower.idle(IDLE_2); to work for Arduino Zero.

    See my simple code below that flashes a LED. The data sheet for SAMD21 says that in idle mode the CPU stops, but my code keeps running, ie LED keeps flashing. If I replace LowPower.idle(IDLE_2); with LowPower.standby(); the CPU stops but not with idle. Why?

    Thanks.

    #include “LowPower.h”
    void setup() {
    pinMode(26, OUTPUT);
    }

    void loop()
    {
    LowPower.idle(IDLE_2);

    digitalWrite(26, LOW);
    delay(500);
    digitalWrite(26, HIGH);
    delay(500);
    }

    #11161
    LIM PHANG MOH
    Keymaster

    I doubt that you can even compile it at the first place.
    The idle function call doesn’t exist for SAMD21 core. It is only available for the AVR variant.

    #11172
    boggydew
    Participant

    Hi,

    No, it is definitely intended for the SAMD21, see code from LowPower.h below:
    #if defined (__SAMD21G18A__)
    void idle(idle_t idleMode);
    void standby();
    #else
    #error “Please ensure chosen MCU is ATSAMD21G18A.”
    #endif

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.