-
-
Save usagi/6137669 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 <StandardCplusplus.h> | |
#include <system_configuration.h> | |
#include <unwind-cxx.h> | |
#include <utility.h> | |
#include <iterator> | |
#include <vector> | |
#include <chrono> | |
static const int serial_speed = 115200; | |
static const int read_pin = 3; | |
static const unsigned elements = 100; | |
typedef unsigned long time_t; | |
void setup() | |
{ | |
Serial.begin(serial_speed); | |
} | |
void loop() | |
{ | |
vector<int> a(elements); | |
time_t start_time = micros(); | |
for(vector<int>::iterator i = a.begin(); i != a.end(); ++i) | |
*i = analogRead(read_pin); | |
span = micros() - start_time; | |
Serial.println(span); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment