connecting a raspberry with a touch sensor through processing?

edited June 2016 in Raspberry PI

hello processors!

I am looking to connect a touch sensor with my raspberry pi to trigger a video. I waned to do it in PD but seems the gem its not supported on pi3. someone told me to have a go at processing instead?

have anyone done something similar? how do i read the input of the sensor into processing and have the inpurt affect the video? fx. the playback speed of the video...

really hope someone can help! best, line

Tagged:

Answers

  • Depends on the sensor & the data it sends - if it sends out an analog signal, you can read that with an ADC which communicates with pi via SPI. Which sensor is it?

  • would i need to connect the sensor to an arduino and then to my pi you think? it seems the I2C on the sensor goes directly with pi?

    sorry im just super new in this, so it might be im a little lost :S :)

  • edited June 2016

    Yes this should connect via I2C directly to the pi, no need for an arduino.

  • I know this might be a lot to ask, but do you have any tips on how to read the sensor data into processing? (and maybe link it with a video)

  • Slightly depends on the code it puts out - here's SPI code for an ADC, so it won't be too far off this:

    https://forum.processing.org/two/discussion/comment/69408/#Comment_69408

    Use Mike's code not mine! Once it's in you can usually extract the important bit from the data received.

  • Looks like there is a python library so that might be the line of least resistance. The other alternative is to 'bit bang' via the SPI interface - you just read the datasheets and send the expected sequence of 1s and 0s and look at what comes back - more tricky but means you can stay within processing. Or, you could stick an ardunio in the middle, use the adafruit arduino library and just get the pi to talk with arduino - more hardware but might save some coding time.

Sign In or Register to comment.