Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SmartSwitch TMRh20 mbed
Diff: main.cpp
- Revision:
- 5:ed147c3ecb57
- Parent:
- 4:6efe063cdbb2
--- a/main.cpp Tue Mar 22 15:21:02 2016 +0000
+++ b/main.cpp Thu Mar 24 14:10:13 2016 +0000
@@ -6,14 +6,14 @@
AnalogIn adc2(A2);
AnalogIn adc3(A3);
AnalogIn adc4(A4);
-AnalogIn adc5(A5);
-
+//AnalogIn adc5(A5);
+//AnalogIn adc5(D0);
DigitalOut led(D3);
DeafNode *deafNode;
Serial pc(USBTX, USBRX);
-#define SAMPLE_SIZE 480
+#define SAMPLE_SIZE 960
#define PRESAMPLE_SIZE 60
// Buffers to store the samples of the 6 channels
uint8_t buffer0[SAMPLE_SIZE];
@@ -21,7 +21,7 @@
uint8_t buffer2[SAMPLE_SIZE];
uint8_t buffer3[SAMPLE_SIZE];
uint8_t buffer4[SAMPLE_SIZE];
-uint8_t buffer5[SAMPLE_SIZE];
+//uint8_t buffer5[SAMPLE_SIZE];
uint8_t sid;
@@ -47,7 +47,7 @@
buffer2[sample_pointer] = adc2.read_u16() >> 8;
buffer3[sample_pointer] = adc3.read_u16() >> 8;
buffer4[sample_pointer] = adc4.read_u16() >> 8;
- buffer5[sample_pointer] = adc5.read_u16() >> 8;
+// buffer5[sample_pointer] = adc5.read_u16() >> 8;
//buffer0[sample_pointer] = 120;
//buffer1[sample_pointer] = 121;
@@ -66,7 +66,7 @@
else if (buffer2[sample_pointer] > DCVAL + THRESHOLD || buffer2[sample_pointer] < DCVAL - THRESHOLD) threshold = true;
else if (buffer3[sample_pointer] > DCVAL + THRESHOLD || buffer3[sample_pointer] < DCVAL - THRESHOLD) threshold = true;
else if (buffer4[sample_pointer] > DCVAL + THRESHOLD || buffer4[sample_pointer] < DCVAL - THRESHOLD) threshold = true;
- else if (buffer5[sample_pointer] > DCVAL + THRESHOLD || buffer5[sample_pointer] < DCVAL - THRESHOLD) threshold = true;
+ // else if (buffer5[sample_pointer] > DCVAL + THRESHOLD || buffer5[sample_pointer] < DCVAL - THRESHOLD) threshold = true;
return threshold;
}
@@ -161,7 +161,7 @@
sendSamples(sid, 2, buffer2, SAMPLE_SIZE, sample_start);
sendSamples(sid, 3, buffer3, SAMPLE_SIZE, sample_start);
sendSamples(sid, 4, buffer4, SAMPLE_SIZE, sample_start);
- sendSamples(sid, 5, buffer5, SAMPLE_SIZE, sample_start);
+// sendSamples(sid, 5, buffer5, SAMPLE_SIZE, sample_start);
printf("\nSamples were sent (%d).\n", r);
}
sid++;