Skip to content

Commit 8162ecf

Browse files
committed
Fix index bug in SendData.cpp
1 parent a3322ae commit 8162ecf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

examples/SendData.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ int main(int argc, char *argv[]) {
8484
// send data forever
8585
std::cout << "Now sending data... " << std::endl;
8686
for (unsigned t = 0;; t++) {
87-
8887
// Create random data for the first 8 channels.
8988
for (int c = 0; c < 8; c++) sample[c] = (float)((rand() % 1500) / 500.0 - 1.5);
9089
// For the remaining channels, fill them with a sample counter (wraps at 1M).
@@ -99,7 +98,7 @@ int main(int argc, char *argv[]) {
9998

10099
// send the sample
101100
if (contig) {
102-
std::cout << sample[0] << "\t" << sample[8] << std::endl;
101+
std::cout << sample[0] << "\t" << sample[n_channels-1] << std::endl;
103102
outlet.push_sample(sample);
104103
} else {
105104
// Advanced: Push set of discontiguous buffers.

0 commit comments

Comments
 (0)