Skip to content

Instantly share code, notes, and snippets.

@toya33
Forked from usagi/substitution_process.ino
Last active December 20, 2015 14:29
Show Gist options
  • Save toya33/6146881 to your computer and use it in GitHub Desktop.
Save toya33/6146881 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>
#include <Utility.h>
static const int serial_speed = 9600;
static const int read_pin = 3;
static const unsigned elements = 100;
typedef unsigned long time_t;
using namespace std;
void setup()
{
Serial.begin(serial_speed);
}
void loop()
{
setADCFrequency(ADC_DIV8);
vector<int> a(elements);
time_t start_time = micros();
for(vector<int>::iterator i = a.begin(); i != a.end(); ++i)
*i = analogRead(read_pin);
time_t span = micros() - start_time;
Serial.println(span);
delay(1000);
}
@toya33
Copy link
Author

toya33 commented Aug 4, 2013

コンパイルエラー時のテキスト

substitution_process_ver2.ino: In function 'void loop()':
substitution_process_ver2:26: error: 'ADC_DIV8' was not declared in this scope
substitution_process_ver2:26: error: 'setADCFrequency' was not declared in this scope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment