Created
April 8, 2017 15:27
-
-
Save giljr/1f350b44200f0c907f17c6aa08096a19 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <FlexiTimer2.h> // use timer for sampling to get even time base for data | |
const int READ_SINE_PIN = A0; | |
const int READ_OUTPUT_PIN = A1; | |
int inverted_value = 0; | |
void setup() { | |
Serial.begin(115200); // initialize serial communications (to match that used by PlotNValues.pde) | |
FlexiTimer2::set(10, sample); | |
FlexiTimer2::start(); | |
} | |
void loop() { | |
//wait interruption | |
} | |
// sample values and pipe to processing | |
void sample() { | |
String result = ""; | |
Serial.println(result + analogRead(READ_SINE_PIN) + "," + analogRead(READ_OUTPUT_PIN)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment