• aroomforimprovement

    Hi,

    I've made a simple patch that calls a video clip when an analog reading form pduino is below a certain value and calls another clip when the reading is above another certain value - making the analog reading act as a switch.

    It works fine using a potentiometer but I need to use an LDR, which is giving extrememly jumpy readings, which I need to smooth out. I tried splicing in the arduino Smoothing example into the Standard Firmata example but that didn't seem to work. It seems, for this and future projects, it would be really handy to be able to set up an array inside my pd patch that could collect and average out a number of readings but I'm stumped on how to do this and can't find anything already online.

    Anyone know how I can smooth out this sensor reading... before a college tutorial on Tuesday?

    Thanks in advance!

    posted in I/O hardware diyread more
  • aroomforimprovement

    Thanks so much!

    This seems an elegant solution.
    I'm attaching a further development of how I solved the particular problem I was having - which was that the analog sensor reading kept jumping to zero, a few times every second. I used [moses] object to create a kind of gate that would stop the zero reading from affecting the output. It's possible that the [mean] here is now superfluous, not sure.

    For this patch to be useful, one would have to have the particular hardware glitch that I was having but I think it's probably not uncommon with cheap LDRs and, in any case, you may find a beginner's solution to this particular problem amusing.

    Thanks again for the above patch though, I'll be adapting for a lots of projects, I'm sure.

    http://www.pdpatchrepo.info/hurleur/pdAnalogGate.jpg

    posted in I/O hardware diyread more
  • aroomforimprovement

    Hi,

    Thanks for the pointers. What I've done so far is used the [mean] object with a [metro] to clear the total at quite a fast interval. Seems to be helping - although, I think for my purposes, I should eventually learn the ins and outs of [tabwrite].

    Thanks again

    posted in I/O hardware diyread more

Internal error.

Oops! Looks like something went wrong!