Compare commits

..

10 Commits

3 changed files with 57 additions and 0 deletions

17
matlab/dAUIS.m Normal file
View File

@ -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

1
matlab/test_function.m Normal file
View File

@ -0,0 +1 @@
dAUIS(1);

39
polling/polling.ino Normal file
View File

@ -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++;
}
}