[PD] Sensors GPIO Raspberry Pi Pd

Martin Peach martin.peach at sympatico.ca
Fri May 17 18:44:36 CEST 2013


Yep. Here's a diagram that shows the wiring.

Martin

On 2013-05-17 11:42, Julian Brooks wrote:
> Aargh - you're right, I am confused (so very)...
>
> So, to be clear
> #define SENSOR_SELECT_PIN 11
> should be
> #define SENSOR_SELECT_PIN 17
> After all?
>
> It is then going to pin 11 on the 4051.
>
> Running as root so need for sudo (yes I know)
>
> As Max Romeo said:
> "One step forwards, two steps backwards" :)
>
> J
>
> Will try the led test and the updated code when I can get back to it in
> a couple of days or so.
>
>
> On 17 May 2013 16:20, Martin Peach <martin.peach at sympatico.ca
> <mailto:martin.peach at sympatico.ca>> wrote:
>
>     It looks like you're confused about the GPIO pin.
>     SENSOR_SELECT_PIN should be 17 because that's what the ARM chip
>     calls it. The fact that it is on pin 11 of the header is irrelevant
>     to the program.
>     The next confusing thing is that GPIO17 on pin 11 of the header
>     connects to pin 11 of the 4051.
>     If you want to see if the pin is working you can put an LED from pin
>     11 of the header to ground and see if it flashes when you run the
>     program.
>     I had to run it as sudo because regular users don't have permission
>     to access the GPIO pins.
>
>     Martin
>
>
>     On 2013-05-17 10:50, Julian Brooks wrote:
>
>         Sorry meant to attach the code (doh!).
>
>         My compadre has all the photo's on his phone so will give him a
>         nudge
>         now and get back to you when I hear from him...
>
>         (hey George:)
>
>         Thanks for the testing tip - of course, seems so obvious now
>         that you've
>         said it.
>
>         And I guess we can't definitely confirm that the pin switches
>         although
>         the last big problem we had was that I'd set the switch to pin
>         17 rather
>         than pin 11 (gpio 17).  What would happen then is that we would
>         get one
>         reading from the 1st sensor and then it would stall/quit-out.
>
>         More soon hopefully,
>
>         Julian
>
>
>         On 17 May 2013 15:14, Martin Peach <martin.peach at sympatico.ca
>         <mailto:martin.peach at sympatico.ca>
>         <mailto:martin.peach at __sympatico.ca
>         <mailto:martin.peach at sympatico.ca>>> wrote:
>
>              On 2013-05-17 09:39, Julian Brooks wrote:
>
>                  Hey Martin,
>
>                  Can I please peck your head hopefully one last time?
>
>
>              Sure.
>
>
>                  We're so close, got the hardware for the installation
>         up and
>                  running,
>                  box made etc etc.
>
>                  Could you have a once-over of our code:
>                  Still only seeing one sensor though all of our multimeter
>                  testing says
>                  sensor 2 is fine and ready to go.  I think it has to be
>         a code
>                  problem
>                  in the C file but I just_can't\-see\-it!!
>
>
>              You need to show me your code... The file I sent was to
>         read two
>              sensors. The second was the 1X8 sensor so it reads a different
>              number of bytes. You have to change that, everything else
>         should be
>              the same..
>
>
>
>                  Keep wondering if there's a way of being able to test
>         the 2nd
>                  sensor in
>                  a similar vein to sensor 1 with 'i2cdetect', like if we
>         could
>                  shift the
>                  IC switcher so it would allow us to run the test on the
>         2nd one.
>
>
>              Yes, just connect the A select line of the 4051 (pin 11)
>         directly to
>              3.3V or ground to select one or the other. But disconnect
>         the GPIO
>              pin when you do that.
>
>
>
>                  Pd is receiving on both sends (44l & 44l2) but all we
>         have is one
>                  sensors readings - same in the prints from the C file.
>
>
>              Sounds like the multiplexer isn't working right. Do you
>         have a photo
>              of your setup? Can you confirm that the GPIO pin switches?
>
>              Martin
>
>
>
>
>         _________________________________________________
>         Pd-list at iem.at <mailto:Pd-list at iem.at> mailing list
>         UNSUBSCRIBE and account-management ->
>         http://lists.puredata.info/__listinfo/pd-list
>         <http://lists.puredata.info/listinfo/pd-list>
>
>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rpi_i2c_sensors.png
Type: image/png
Size: 20772 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20130517/4fefd983/attachment-0001.png>


More information about the Pd-list mailing list