Skip to content

Commit 30f2477

Browse files
authored
Merge pull request #673 from aliphys/aliphys/selectGreyScaleStatus
[AE-79] Switch `useGreyScale` value in Processing sketch without changing code
2 parents f57f3fc + c35258a commit 30f2477

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: libraries/Camera/extras/CameraRawBytesVisualizer/CameraRawBytesVisualizer.pde

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final int cameraWidth = 320;
1717
final int cameraHeight = 240;
1818

1919
// Must match the image mode in the Arduino sketch
20-
final boolean useGrayScale = true;
20+
boolean useGrayScale = true;
2121

2222
// Must match the baud rate in the Arduino sketch
2323
final int baudRate = 115200;
@@ -120,3 +120,9 @@ void serialEvent(Serial myPort) {
120120
// and are ready for the next frame
121121
myPort.write(1);
122122
}
123+
124+
void keyPressed() {
125+
if (key == ' ') {
126+
useGrayScale = !useGrayScale; // change boolean value of greyscale when space is pressed
127+
}
128+
}

0 commit comments

Comments
 (0)