-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSurfVisualization.cpp
51 lines (34 loc) · 1014 Bytes
/
SurfVisualization.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) 2013 Hyperceptive, LLC
// Use of this source code is governed by The MIT License
// that can be found in the LICENSE file.
#include "DisplayUpdater.h"
#include "LedMatrixBuoyViz.h"
#include "RgbMatrix.h"
#include "RgbMatrixContainer.h"
#include <cstdio>
int main(int argc, char *argv[])
{
GpioProxy io;
if (!io.initialize())
return 1;
RgbMatrix *m = NULL;
m = new RgbMatrix(&io);
RgbMatrixContainer *display = NULL;
RgbMatrixContainer *updater = NULL;
updater = new DisplayUpdater(m);
display = new LedMatrixBuoyViz(m, (DisplayUpdater*)updater);
printf("\nRunning the Buoy Data Visualization.\n\n");
updater->start(10);
display->start();
printf("Press <RETURN> when done.\n");
getchar();
printf("Signaling visualization to stop.\n\n");
// Stop threads and wait for them to join.
if (display) delete display;
if (updater) delete updater;
// Clear and refresh the display.
m->clearDisplay();
m->updateDisplay();
delete m;
return 0;
}