aboutsummaryrefslogtreecommitdiff
path: root/examples/Pd_Input
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-03-05 06:48:01 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-03-05 06:48:01 +0000
commit01226f1e1e0db8cdff714999a71fddb218562c45 (patch)
treeb6d34371af5aed94f170e17bb95201da02a70392 /examples/Pd_Input
parent9a3ca9f757a699cea97dec772c4b8d446d06ad21 (diff)
some example patches for the existing puredata firmwares, and the start of firmware for getting all inputs into Pd as fast as possible. Some clean-up needed before a real release
svn path=/trunk/externals/hardware/arduino/; revision=4647
Diffstat (limited to 'examples/Pd_Input')
-rw-r--r--examples/Pd_Input/Pd_Input.pde33
1 files changed, 33 insertions, 0 deletions
diff --git a/examples/Pd_Input/Pd_Input.pde b/examples/Pd_Input/Pd_Input.pde
new file mode 100644
index 0000000..d5dd5e7
--- /dev/null
+++ b/examples/Pd_Input/Pd_Input.pde
@@ -0,0 +1,33 @@
+/* Pd_Input
+ * ------------------
+ *
+ * This program reads all of the Analog inputs
+ * and sends the data to the computer as fast as
+ * possible. It was designed to work with the Pd
+ * patch of the same name in:
+ * Help -> Browser -> examples -> hardware
+ *
+ * (cleft) 2006 Hans-Christoph Steiner
+ * @author: Hans-Christoph Steiner
+ * @date: 2006-03-04
+ * @location: Polytechnic University, Brooklyn, New York, USA
+ */
+
+/*
+ * CAUTION!! Do not turn on the Serial Monitor, it could freeze
+ * your computer with this firmware running! It outputs data
+ * without a delay() so its very fast.
+ */
+
+int potPin = 0;
+void setup() {
+ beginSerial(19200);
+}
+
+void loop() {
+ printByte(potPin + 65); // add 65 to get ASCII chars starting with A
+ printInteger(analogRead(potPin));
+ potPin = potPin + 1;
+ if (potPin > 5)
+ potPin = 0;
+}