Skip to content

Commit fb6f343

Browse files
authored
Merge pull request #1 from HTM-Workshop/capture_modes
Capture modes
2 parents 74d6723 + 56af496 commit fb6f343

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
package_builds/
1+
package_builds
2+
*.log

diyemg_sketch_1.1-a.1/diyemg_sketch_1.1-a.1.ino renamed to diyemg_sketch_1.2-a.1/diyemg_sketch_1.2-a.1.ino

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* DIY Spiker unit controller - v1.0
1+
/* DIY Spiker unit controller - v1.2
22
Written by Kevin Williams
33
10/26/2020:
44
- Complete rewrite to match new hardware specifications
@@ -72,11 +72,20 @@ inline void __attribute__((optimize("O3"))) update_output(const int level) {
7272
return;
7373
}
7474

75+
ISR(TIMER1_OVF_vect) {
76+
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
77+
}
7578

7679
void setup(void) {
7780
Serial.begin(115200);
7881
String mode;
7982
char buff[10];
83+
84+
// standby signal
85+
TCCR1A = 0;
86+
TCCR1B = 0x3;
87+
TCNT1 = 0;
88+
TIMSK1 = _BV(TOIE1); // enable TIMER2 overflow interrupt
8089

8190
// indicator
8291
pinMode(LED_BUILTIN, OUTPUT);
@@ -146,6 +155,10 @@ void setup(void) {
146155
// 0 = A0, 1 = A1
147156
ADMUX = (1 << REFS0) | channel_select;
148157
ADCSRA = 0x82;
158+
159+
// disable status led
160+
TIMSK1 = 0;
161+
digitalWrite(LED_BUILTIN, 0);
149162
}
150163

151164

0 commit comments

Comments
 (0)