1/*
2 Usage
3 This example demonstrates how to use the SAMD SFU library to update a 
4 sketch on any Arduino MKR board connected to a MKRMEM Shield. This sketch
5 prints out the date and time the sketch was compiled.
6
7 Steps to update sketch via MKRMEM shield:
8
9 1) Upload this sketch or another sketch that includes the SFU library
10    via #include <SFU.h>
11
12 2) Update the sketch as desired. For this example the sketch prints out
13    the compiled date and time so no updates are needed.
14
15 3) In the IDE select: Sketch -> Export compiled Binary
16
17 4) Write the .bin file from the sketch's folder to the MKRMEM shield using
18    the MKRMEM_WriteUpdate sketch.
19
20 created 15 April 2020
21 by Alexander Entinger
22*/
23
24/*
25 Include the SFU library 
26 
27 This will add some code to the sketch before setup() is called
28 to check if UPDATE.bin is present on the flash chip of the MKRMEM
29 shield. If this theck is positive the file is used to update the sketch
30 running on the board. After this UPDATE.bin is deleted from the flash.
31*/
32#include <SFU.h>
33
34void setup() {
35  Serial.begin(9600);
36
37  // wait a bit
38  delay(1000);
39
40  String message;
41  message += "Sketch compile date and time: ";
42  message += __DATE__;
43  message += " ";
44  message += __TIME__;
45
46  // print out the sketch compile date and time on the serial port
47  Serial.println(message);
48}
49
50void loop() {
51  // add you own code here
52}
53
54