From d9d68bcebdfa43b58a513fb6cf8b8c91c3fa6e3e Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sat, 20 May 2006 16:26:57 +0000 Subject: looks like analog input is working fine, next, the digital inputs need to be tested. svn path=/trunk/externals/hardware/arduino/; revision=5096 --- Pd_firmware/Pd_firmware.pde | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) (limited to 'Pd_firmware/Pd_firmware.pde') diff --git a/Pd_firmware/Pd_firmware.pde b/Pd_firmware/Pd_firmware.pde index 6265f26..ba93885 100644 --- a/Pd_firmware/Pd_firmware.pde +++ b/Pd_firmware/Pd_firmware.pde @@ -251,35 +251,26 @@ void setup() { // ------------------------------------------------------------------------- void loop() { - // read all digital pins - //transmitDigitalInput(0); - //transmitDigitalInput(7); /* * get analog in */ - /* - for(analogPin=0; analogPin<5; ++analogPin) - { - analogData = analogRead(analogPin); - // these two bytes get converted back into the whole number in Pd - printByte(analogData >> 7); // bitshift the big stuff into the output byte - printByte(analogData % 128); // mod by 32 for the small byte - } - */ - // ++analogPin; - // if (analogPin > 5) analogPin = 0; - /* end with the cycle marker */ - // bitshift the big stuff into the output byte - printByte(digitalPinStatus >> 7); - // clear the 8th bit before truncating to a byte for small data byte - printByte(digitalPinStatus % 128); + for(analogPin=0; analogPin<6; ++analogPin) + { + analogData = analogRead(analogPin); + // these two bytes get converted back into the whole number in Pd + printByte(analogData >> 7); // bitshift the big stuff into the output byte + printByte(analogData % 128); // mod by 32 for the small byte + } - printByte(pwmStatus >> 7); - printByte(pwmStatus % 128); + // read all digital pins + transmitDigitalInput(0); + transmitDigitalInput(7); checkForInput(); + /* end with the cycle marker */ printByte(255); - setPinMode(13,OUTPUT); - digitalWrite(13,HIGH); + + // setPinMode(13,OUTPUT); + // digitalWrite(13,HIGH); } -- cgit v1.2.1