Skip to content

Instantly share code, notes, and snippets.

@usagi
Forked from toya33/substitution_process.ino
Last active December 20, 2015 13:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save usagi/6137669 to your computer and use it in GitHub Desktop.
Save usagi/6137669 to your computer and use it in GitHub Desktop.
#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