Spin demo code for the TSL235?
vanmunch
Posts: 568
Hey everyone, I'm evaluation some different color sensors and I would like to try a TSL235 (?R?), but I haven't been able to find any Spin code for it. http://www.parallax.com/product/604-00084 There is an example for using an Arduino from Parallax, but nothing for the Propeller chip. I think the world is upside down....
http://learn.parallax.com/tsl235r-light-frequency-converter-arduino-demo
I've also checked the Obex and no luck, does anyone have a simple demo that they would be willing to share?
Thanks for your time,
Dave
http://learn.parallax.com/tsl235r-light-frequency-converter-arduino-demo
I've also checked the Obex and no luck, does anyone have a simple demo that they would be willing to share?
Thanks for your time,
Dave
Comments
Hey JonnyMac,
Thanks for asking.
The goal is to find the best method and sensor(s) for detecting (individually) red, green, blue, IR, & UV light reflected from an object about 2-3 inches away.
I've currently been testing a number of different sensors (photo-resistors, photo-resistor diodes, TSL235, etc.) In the end I'll create an array of 5-12 covering an area about 8 inches wide. The refresh rate will need to be at least 10 hz. I had been planning on dedicating a cog for this job.
BTW I always enjoy reading your articles in N&V.
Dave
The key to my code is using a counter in POSEDGE mode -- this mimics the edge-triggered interrupt of the Arduino. You can easily drop this code into a Spin cog to provide a count/period to your foreground application.