-
-
Save toya33/6146881 to your computer and use it in GitHub Desktop.
This file contains 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> | |
#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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
コンパイルエラー時のテキスト
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