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!