With Arduino and Max.
An update to the basic Arduino/Max patches: https://reactivemusic.net/?p=11809
Replace the potentiometer in the “Arduino Serial Read” project with a photocell (LDR: Light dependent resistor) and a 10K pulldown resistor, wired as shown in the image above and explained here: https://learn.adafruit.com/photocells/using-a-photocell (from Adadfruit)
The “Analog” lead represents the center terminal of a potentiometer and connects to A0.
The Arduino sketch is the example sketch: Analog | analogInOutSerial
download
https://github.com/tkzic/max-projects
folder: arduino-basics
patch: arduino-serial-read-midi.maxpat
For instructions and circuit, refer to “Arduino Serial Read” project: https://reactivemusic.net/?p=11809