Compare commits
10 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
8489014feb | |
|
|
314cb3e345 | |
|
|
f30dcf419d | |
|
|
bae9237575 | |
|
|
be0a4fec47 | |
|
|
a947b89198 | |
|
|
777638a922 | |
|
|
f5b8fe0840 | |
|
|
692af56499 | |
|
|
c91f01864a |
|
|
@ -0,0 +1,17 @@
|
||||||
|
#determineArduinoUnoInterruptSettings.m
|
||||||
|
function dAUIS(f)
|
||||||
|
prescaler = [1,8,64,256,1024];
|
||||||
|
for i=1:5
|
||||||
|
cmr = (16000000/prescaler(i)*f) - 1;
|
||||||
|
display("prescaler: ");
|
||||||
|
display(prescaler(i));
|
||||||
|
if cmr < 256
|
||||||
|
display("8 bit");
|
||||||
|
elseif cmr < 65536
|
||||||
|
display("16 bit");
|
||||||
|
else
|
||||||
|
display("none available");
|
||||||
|
endif
|
||||||
|
display("");
|
||||||
|
endfor
|
||||||
|
endfunction
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
dAUIS(1);
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
int input;
|
||||||
|
long a;
|
||||||
|
long b;
|
||||||
|
|
||||||
|
int n=0;
|
||||||
|
int i=0;
|
||||||
|
double x[200];
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
Serial.begin(9600);
|
||||||
|
pinMode(A0, INPUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
|
||||||
|
while (n<200) {
|
||||||
|
a = millis();
|
||||||
|
input = analogRead(A0);
|
||||||
|
delay(1000);
|
||||||
|
b = millis();
|
||||||
|
x[n] = b-a;
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (n==200) {
|
||||||
|
Serial.println("Array: ");
|
||||||
|
|
||||||
|
for(i=0;i<200;i++) {
|
||||||
|
Serial.println(x[i]);
|
||||||
|
//Serial.print(";");
|
||||||
|
}
|
||||||
|
|
||||||
|
Serial.print("n: ");
|
||||||
|
Serial.println(n);
|
||||||
|
Serial.println("--------");
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue