Skip to content

Commit 15ddff0

Browse files
authored
Add files via upload
1 parent d259b5e commit 15ddff0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include "avdweb_SWscope.h"
2+
#include <FrequencyTimer2.h> // mainISR https://github.com/PaulStoffregen/FrequencyTimer2
3+
4+
// Attention: set in avdweb_SWscope.h: const int maxScopeBytes = 100; // or more if possible
5+
6+
SWscope scope;
7+
8+
void setup(void)
9+
{ Serial.begin(115200);
10+
FrequencyTimer2::setPeriod(250); // period = 250us
11+
FrequencyTimer2::setOnOverflow(mainISR); // start ISR here
12+
scope.start(2, 10); // 2 integer channels , preSamples = 10, buffer is 100/4=25 integer values
13+
scope.trigger();
14+
}
15+
16+
void mainISR(void)
17+
{ static int internalValue;
18+
internalValue += 2;
19+
scope.probeAB(internalValue, analogRead(A0)); // channel A = internalValue, channel B = ADC
20+
if(internalValue > 10) scope.trigger();
21+
}
22+
23+
void loop(void)
24+
{ scope.showIfReady();
25+
}

0 commit comments

Comments
 (0)