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