aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qa-slave-shield.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qa-slave-shield.cpp')
-rw-r--r--examples/qa-slave-shield.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/examples/qa-slave-shield.cpp b/examples/qa-slave-shield.cpp
new file mode 100644
index 0000000..fcee9cf
--- /dev/null
+++ b/examples/qa-slave-shield.cpp
@@ -0,0 +1,49 @@
+// slave mode for QA shield
+
+#include "wirish.h"
+
+#define LED_PIN 13
+#define NUM_GPIO 38 // not the number of the max...
+
+int i;
+
+void setup()
+{
+ /* Set up the LED to blink */
+ pinMode(LED_PIN, OUTPUT);
+ digitalWrite(LED_PIN, 1);
+
+ for(i=0; i<NUM_GPIO; i++) {
+ if(i==13) { continue; }
+ pinMode(i, OUTPUT);
+ digitalWrite(i,0);
+ }
+ //delay(5000);
+ SerialUSB.println("OK, starting...");
+
+}
+
+void loop() {
+ digitalWrite(LED_PIN,1);
+ delay(100);
+ digitalWrite(LED_PIN,0);
+
+ for(i=0; i<NUM_GPIO; i++) {
+ if(i==13) { continue; }
+ digitalWrite(i,1);
+ delay(5);
+ digitalWrite(i,0);
+ delay(5);
+ }
+}
+
+
+int main(void) {
+ init();
+ setup();
+
+ while (1) {
+ loop();
+ }
+ return 0;
+}