From 0cbfc9a45fc6b222f1ebee03f1a427e2e27343de Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Wed, 16 Oct 2019 18:51:39 -0600 Subject: [PATCH] Add example to show Apollo3 IC revision --- .../DisplayICRevision/DisplayICRevision.ino | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 libraries/Examples/examples/Advanced/DisplayICRevision/DisplayICRevision.ino diff --git a/libraries/Examples/examples/Advanced/DisplayICRevision/DisplayICRevision.ino b/libraries/Examples/examples/Advanced/DisplayICRevision/DisplayICRevision.ino new file mode 100644 index 00000000..80278842 --- /dev/null +++ b/libraries/Examples/examples/Advanced/DisplayICRevision/DisplayICRevision.ino @@ -0,0 +1,42 @@ +/* Author: Nathan Seidle + Created: October 16th, 2019 + License: MIT. See SparkFun Arduino Apollo3 Project for more information + + This example demonstrates how to display the revision of the Apollo3. + See the Ambiq website for errata on each revision: https://ambiqmicro.com/mcu/ +*/ +void setup() +{ + Serial.begin(115200); + delay(10); //Wait for any bootloader UART interactions to complete + Serial.println(); + Serial.print("Apollo3 IC revision code: "); + + if (APOLLO3_A0) + { + Serial.print("A0"); + } + else if (APOLLO3_A1) + { + Serial.print("A1"); + } + else if (APOLLO3_B0) + { + Serial.print("B0"); + } + else if (APOLLO3_GE_B0) + { + Serial.print("Unknown revision but it's greater than B0"); + } + else + { + Serial.print("Unknown revision"); + } + Serial.println(); + Serial.println("All done"); +} + +void loop() +{ + //Do nothing +} \ No newline at end of file