I’m used to using sensors on Arduino, but having problems understanding use on Pi. It seems Processing has GPIO function, but it isn’t clear to me whether you can hook up a Lux sensor (like TSL2561) to the Pi and expect it to read values using Processing (especially since sensors usually require a specific library). So far I’m only seeing Python scripts for sensors without using Processing for Pi.
My end use is having a light sensor trigger video (using Processing’s GL Video). So, being able to exclude an Arduino would be nice.
Hi @Zengirl2 - so the TSL2561 uses I2C to communicate with the host computer. You can use Hardware I/O library’s I2C class to talk I2C with the device. If you look at the examples that come with the Hardware I/O library, you’ll find a few whose name start with I2C. Those are not implementing the needed code for your specific device, but should give you a general idea.
If you already have a Python script, than it would only be a manner of taking the I2C related code from there and translating it to something that uses Processing’s I2C class. (That’s generally easier than writing code from scratch looking only at the device’s datasheet - but this can be a fun challenge also.)
If you don’t get around to doing this conversion yourself, post the link to the Python code, and I’ll give it a try.