Pin pullup not waking cores from sleep (Waking by itself)

Hi,

I’m trying to get a core to wakeup when a switch is on.
It is a black PCB Spark Core.
I’ve followed the instructions to update the boot loader. It seems to be updating fine (to v0.3.3).

Here is my code.

void setup() {
 Serial.begin(9600);
 pinMode(D1, INPUT);
}

void loop(){
 Serial.println("First Delay");
 delay(20000);
 Serial.println(digitalRead(D1));
 Serial.println("Second Delay");
 delay(20000);
 Serial.println("Sleep");
 Spark.sleep(D1,RISING);
 }

(The delays are there just to buy me time so I can do over the air updates.)

Here is a little sketch of the hardware setup:

I’ve tested through serial printing that the D1 is normally 0 except for when a magnet is activating the reed switch.

Whenever the core goes into to sleep mode, it wakes up again a few seconds later.

Any suggestions?

Thanks in advance!

As in this thread your Core might have fooled you into believing the bootloader was updated correctly.
Just try out the steps described here again.

1 Like

I was transferring the wrong .bin. Thanks!

3 Likes