| 17: end while |
| 18: end function |
| 19: define transmitImage() function |
| 20: transmit special identifier for image data using transmitChar((char)3) |
| 21: for i = 0 to 239 (representing each line of the image) do |
| 22: for j = 0 to 319 (representing each pixel in the line) do |
| 23: pixelValue <- analogRead(cameraPin) |
| 24: scaledValue <- map pixelValue from range 0-1023 to 0-255 |
| 25: write scaledValue to ledPin |
| 26: delay for 1000000 / sampleRate microseconds |
| 27: end for (inner loop for j) |
| 28: end for (outer loop for i) |
| 29: end function |