diff --git a/UsbReceive.ino b/UsbReceive.ino deleted file mode 100644 index 94da7ff94e59e553bf5d284aa76b8d0ce602031f..0000000000000000000000000000000000000000 --- a/UsbReceive.ino +++ /dev/null @@ -1,59 +0,0 @@ -/************************************************************************* -* Code that reads values sent from python through serial - ************************************************************************/ - -#include <Wire.h> // For I2C communication with sensor -#include <Wireling.h> // For interfacing with Wirelings - -// Make Serial Monitor compatible for all TinyCircuits processors -#if defined(ARDUINO_ARCH_AVR) - #define SerialMonitorInterface Serial -#elif defined(ARDUINO_ARCH_SAMD) - #define SerialMonitorInterface SerialUSB -#endif - - -void setup() { - - SerialMonitorInterface.begin(115200); - Wire.begin(); - - // Initialize Wireling - Wireling.begin(); - Wireling.selectPort(0); - - analogWriteResolution(10); //Change the DAC resolution to 10-bits - analogWrite(A0, 0); // Initialize Dac to Zero - -} - -void loop() { - int output; - //static float x = 270; // Current degrees for sine wave (initially 270 so that - // the sine wave is initially zero). - - // output = (int) (512.0 * sin(0.017453 * x) + 512); // Sine Wave - if (SerialMonitorInterface.available()> -1) { - output = SerialMonitorInterface.parseInt(); - - analogWrite(A0, output); - - }// end if serial available - //analogWrite(A0, output); // Write the analog output to A0 - //SerialMonitorInterface.print(output); - //SerialMonitorInterface.println(); - - /* - * Increment Degrees for the Next Wave Point - * - * To utilize the entire resolution of the 10-bit DAC, at least 1024 - * values must be used between 0 and 360 degrees. Therefore, a step - * value greater than 360/1024 will not utilize the entier resolution - * of the DAC. - */ - //x += 0.35; - //if(x>=360.0) x -= 360.0; - - - //delay(1); -}